http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60926
--- Comment #10 from gidici61 at gmail dot com ---
(In reply to gidici61 from comment #9)
> I apologize. I forgot to specify that I used a 64 bit version of OS.
I should have written "System V ABi x86-64".
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60926
--- Comment #9 from gidici61 at gmail dot com ---
I apologize. I forgot to specify that I used a 64 bit version of OS.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60926
--- Comment #8 from gidici61 at gmail dot com ---
(In reply to H.J. Lu from comment #7)
> Since GCC finds out that g2 only needs 8 byte stack alignment,
> it only needs to align stack to 8 byte when calling g2.
Thank you. So this should
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60926
--- Comment #6 from gidici61 at gmail dot com ---
I don't understand why the addition of "putchar(p1)" in g2() C code changes
"subq $8, %rsp" to "subq $16 %rsp", while all the other assembler code remain
unch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60926
--- Comment #5 from gidici61 at gmail dot com ---
Please see also:
http://stackoverflow.com/questions/22941372/gcc-4-7-2-in-debian-wheezy-doesnt-always-properly-align-stack-pointer-is-this/23055211#23055211
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60926
--- Comment #4 from gidici61 at gmail dot com ---
(In reply to Andrew Pinski from comment #3)
> (In reply to gidici61 from comment #2)
> > Register rsp is correctly aligned before "call g1"; let's assume rsp=0xB0.
> >
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60926
--- Comment #2 from gidici61 at gmail dot com ---
Register rsp is correctly aligned before "call g1"; let's assume rsp=0xB0.
"call g1" pushes rip (8 bytes) on the stack. Now rsp=0xA8.
Then "pushq %rbp" subtrac
nt: c
Assignee: unassigned at gcc dot gnu.org
Reporter: gidici61 at gmail dot com
Assembly code of the sample C code:
int g2(int p1) { return p1; }
int g1(int p1) { return g2(p1); }
int main() { return g1(65); }
when compiled [ยน] on Debian wheezy using gcc v.