[Bug c/49016] always_inline causes references below the current stack pointer

merrill_707_1 at yahoo dot com gcc-bugzilla@gcc.gnu.org
Tue May 17 14:12:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49016

--- Comment #7 from Lee Merrill <merrill_707_1 at yahoo dot com> 2011-05-17 13:42:23 UTC ---
I think what is happening in the compiler BTW is that a "sub $XX, %rsp" is
dropping out, perhaps as an optimization. If for example, you comment out the
"#define inline" line in the test code, a stack adjustment appears:

   0:   55                      push   %rbp
   1:   48 89 e5                mov    %rsp,%rbp
   4:   48 83 ec 10             sub    $0x10,%rsp       # SP adjustment here
   8:   48 89 7d f8             mov    %rdi,-0x8(%rbp)
   c:   89 75 f4                mov    %esi,-0xc(%rbp)
etc.

And as far as using stack space below your stack pointer, suppose someone has
an operating system that runs applications at the same privilege level as the
OS?



More information about the Gcc-bugs mailing list