https://gcc.gnu.org/g:bb819067b3037dbc847aef6c46b8dc6cd5b50962
commit r14-9661-gbb819067b3037dbc847aef6c46b8dc6cd5b50962 Author: YunQiang Su <s...@gcc.gnu.org> Date: Wed Mar 20 16:25:04 2024 +0800 MIPS: Predefine __mips_strict_alignment if STRICT_ALIGNMENT 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. Note 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. Diff: --- gcc/config/mips/mips.h | 3 +++ 1 file changed, 3 insertions(+) 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)