Add -m[no]-csr-check option in gcc part, when enable -mcsr-check option,
it will add csr-check in .option section and pass this to assembler.
gcc/ChangeLog:
* config/riscv/riscv.cc (riscv_file_start): New .option.
* config/riscv/riscv.opt: New options.
* doc/invoke.texi: New definations.
if (! riscv_mrelax)
fprintf (asm_out_file, "\t.option norelax\n");
+ /* If the user specifies "-mcsr-check" on the command line then enable csr
+ check in the assembler. */
+ if (riscv_mcsr_check)
+ fprintf (asm_out_file, "\t.option csr-check\n");
+
if (riscv_emit_attribute_p)
riscv_emit_attribute ();
}
Take advantage of linker relaxations to reduce the number of instructions
required to materialize symbol addresses.
+mcsr-check
+Target Bool Var(riscv_mcsr_check) Init(0)
+Enable the CSR checking for the ISA-dependent CRS and the read-only CSR.
+The ISA-dependent CSR are only valid when the specific ISA is set. The
+read-only CSR can not be written by the CSR instructions.
+
Mask(64BIT)
Mask(MUL)
-mbig-endian -mlittle-endian @gol
-mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
-mstack-protector-guard-offset=@var{offset}}
+-mcsr-check -mno-csr-check @gol
@emph{RL78 Options}
@gccoptlist{-msim -mmul=none -mmul=g13 -mmul=g14 -mallregs @gol
Emit (do not emit) RISC-V attribute to record extra information into ELF
objects. This feature requires at least binutils 2.32.
+@item -mcsr-check
+@itemx -mno-csr-check
+@opindex mcsr-check
+Enables or disables the CSR checking.
+
@item -malign-data=@var{type}
@opindex malign-data
Control how GCC aligns variables and constants of array, structure, or union