https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103125
Bug ID: 103125 Summary: [ARM]Useless stack initialization on aarch64 big-endian Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: dongjianqiang2 at huawei dot com Target Milestone: --- demo: typedef struct { int a; } S; void foo(S s) { return; } compile with gcc demo.c -mbig-endian -O2 -S output: foo: sub sp, sp, #16 add sp, sp, 16 ret I think the function must not use the stack, just like compiling with LLVM. is this gcc bug? https://gcc.godbolt.org/z/r35a3PbxE