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

            Bug ID: 88483
           Summary: Unnecessary stack alignment
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: ubizjak at gmail dot com
  Target Milestone: ---
            Target: x86

[hjl@gnu-cfl-1 tmp]$ cat x.i
struct B
{
  char a[12];
  int b;
};

struct B
f2 (void)
{
  struct B x = {};
  return x;
}
[hjl@gnu-cfl-1 tmp]$ gcc -S -mavx2 -O2 x.i
[hjl@gnu-cfl-1 tmp]$ cat x.s
        .file   "x.i"
        .text
        .p2align 4,,15
        .globl  f2
        .type   f2, @function
f2:
.LFB0:
        .cfi_startproc
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        xorl    %eax, %eax
        xorl    %edx, %edx
        movq    %rsp, %rbp
        .cfi_def_cfa_register 6
        andq    $-32, %rsp
        leave
        .cfi_def_cfa 7, 8
        ret
        .cfi_endproc

There is no need to realign stack.

Reply via email to