diff mbox series

MIPS: Predefine __mips_strict_alignment if STRICT_ALIGNMENT

Message ID 20240320082504.1192715-1-syq@gcc.gnu.org
State New
Headers show
Series MIPS: Predefine __mips_strict_alignment if STRICT_ALIGNMENT | expand

Commit Message

YunQiang Su March 20, 2024, 8:25 a.m. UTC
Arm32 predefines __ARM_FEATURE_UNALIGNED if -mno-unaligned-access,
and RISC-V predefines __riscv_misaligned_avoid.

Let's define __mips_strict_alignment for MIPSr6 and -mstrict-align
is used.

Not that, this macro is always defined for pre-R6.

gcc
	config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Predefine
	__mips_strict_alignment if STRICT_ALIGNMENT.
---
 gcc/config/mips/mips.h | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 6444a68dfd5..616a275b918 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -694,6 +694,9 @@  struct mips_cpu_info {
 	builtin_define ("__mips_compact_branches_always");		\
       else 								\
 	builtin_define ("__mips_compact_branches_optimal");		\
+									\
+      if (STRICT_ALIGNMENT)						\
+	builtin_define ("__mips_strict_alignment");			\
     }									\
   while (0)