[Bug target/60337] s390: Function arguments are not aligned
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60337 Eric Gallager changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed||2017-09-27 CC||egallager at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #6 from Eric Gallager --- Since this has an assignee I'm changing the status to ASSIGNED
[Bug target/60337] s390: Function arguments are not aligned
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60337 --- Comment #5 from Dominik Vogt vogt at linux dot vnet.ibm.com --- With -O2 and -O3 all three cases generate the proper alignment With -O1 only foo() has the proper alignment With -O0 none of the cases has the proper alignment == Code compiled with -O0 and -O3 accidentally uses a different ABI. Power shows the same erratic behaviour, on amd64 alignment works with all -O{0,1,2,3}.
[Bug target/60337] s390: Function arguments are not aligned
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60337 --- Comment #1 from Dominik Vogt vogt at linux dot vnet.ibm.com --- Created attachment 32209 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32209action=edit test program
[Bug target/60337] s390: Function arguments are not aligned
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60337 --- Comment #2 from Dominik Vogt vogt at linux dot vnet.ibm.com --- (libffi does not honour the alignment either.)
[Bug target/60337] s390: Function arguments are not aligned
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60337 Richard Biener rguenth at gcc dot gnu.org changed: What|Removed |Added Keywords||ABI, diagnostic Target||s390x-*-* --- Comment #3 from Richard Biener rguenth at gcc dot gnu.org --- It's the same on x86 I suppose - the aligned() attribute would have to change the ABI for non-register passing as aligning the argument stack cannot fulfil alignment requirements for more than one argument. IMHO this should be simply diagnosed. I don't see in your testcase where Also, a parameter that is passed in a register and then copied to the stack is not aligned. happens.
[Bug target/60337] s390: Function arguments are not aligned
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60337 --- Comment #4 from Dominik Vogt vogt at linux dot vnet.ibm.com --- It's the same on x86 I suppose Well, the test program works fine on my amd64 box i.e. the alignment is correct in all three functions (I guess foo() needs more int args to force a onto the stack), and from a casual glance at libffi I assume that there is support for that too. I don't see in your testcase where Also, a parameter that is passed in a register and then copied to the stack is not aligned. happens. In the call to baz(). l is passed in a register and then copied to the stack so that the address can be taken to be passed to printf() (verified by looking at the assembler output). Gcc doesn't honour the alignment when moving the register contents onto the stack, it puts the value just at 160(%r15).