https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101934

            Bug ID: 101934
           Summary: [11 Regression] aarch64 memset code creates unaligned
                    stores for -mstrict-align
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---

For:

struct s { char x[95]; };
void foo (struct s *);
void bar (void) { struct s s1 = {}; foo (&s1); }

compiled with -Os -mstrict-align, GCC produces:

bar:
        movi    v0.4s, 0
        stp     x29, x30, [sp, -112]!
        mov     x29, sp
        add     x0, sp, 16
        str     q0, [sp, 80]
        stp     q0, q0, [sp, 16]
        stp     q0, q0, [sp, 48]
        str     q0, [sp, 95]         // <-------- unaligned
        bl      foo
        ldp     x29, x30, [sp], 112
        ret

The *_RATIO macros are already set up to handle STRICT_ALIGNMENT
differently, so presumably we should just make aarch64_expand_setmem
punt in that case.

Reply via email to