This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: c/1624: incorrect stack adjustment with -fomit-frame-pointer on x86


The following reply was made to PR c/1624; it has been noted by GNATS.

From: Richard Henderson <rth@redhat.com>
To: drepper@redhat.com
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: c/1624: incorrect stack adjustment with -fomit-frame-pointer on x86
Date: Tue, 16 Jan 2001 00:42:40 -0800

 On Fri, Jan 12, 2001 at 01:24:08AM -0000, drepper@redhat.com wrote:
 > The problem is that the return address is taken from the wrong stack slot.
 > There is one more value left on the stack (the content of %ebx) which means
 > the main() returns to somewhere in the data area (where %ebx points to).
 
 This appears to be a bug in setjmp.
 
 1: /a $esp = 0xbffff860
 0x8048684 <main+196>:   call   0x804840c <setjmp>
 (gdb) ni
 0x08048689      56            value = setjmp (env);
 1: /a $esp = 0xbffff85c
 0x8048689 <main+201>:   mov    %eax,%ebx
 
 Note that the value of esp is off by 4 on return from that function.
 Interestingly, __sigsetjmp does not display this problem.
 
 This is with glibc-2.2-9 from the rh7 errata installed.
 
 
 r~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]