Skip to content

Commit 961b24a

Browse files
committed
RISC-V: ".option norvc" to disable 'C' and subsets
Despite its deprecation, ".option norvc" may used to turn off the 'C' extension. This commit also disables its subsets, 'Zca', 'Zcf' and 'Zcd' and clarifies that it won't completely do the job if other enabled extensions depend on 'C' or 'Zc*'. Note that, even if it does not "completely" work, we cannot emit any compressed instructions after the ".option norvc" directive since it disables RVC and prevents any 2-byte instructions from assembling. gas/ChangeLog: * config/tc-riscv.c (s_riscv_option): Also turn off 'Zca', 'Zcf' and 'Zcd'. Clarify the limitation of this directive.
1 parent 43e9351 commit 961b24a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gas/config/tc-riscv.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4351,7 +4351,11 @@ s_riscv_option (int x ATTRIBUTE_UNUSED)
43514351
}
43524352
else if (strcmp (name, "norvc") == 0)
43534353
{
4354-
riscv_update_subset (&riscv_rps_as, "-c");
4354+
/* Compatibility:
4355+
Disable classic 'C' extension and its subsets.
4356+
It won't completely disable them if other enabled extensions
4357+
depend on 'C' or 'Zc*'. */
4358+
riscv_update_subset (&riscv_rps_as, "-c,-zca,-zcf,-zcd");
43554359
riscv_reset_subsets_list_arch_str ();
43564360
riscv_set_rvc (false);
43574361
}

0 commit comments

Comments
 (0)