Article View: gnu.gcc.bug
Article #432Re: gcc 2.1 bug with frame ptr handling
From: Jim Wilson
Date: Wed, 15 Apr 1992 23:53
Date: Wed, 15 Apr 1992 23:53
20 lines
866 bytes
866 bytes
The code below on a sparc produces bad code when no opimization is
turned on---note that it uses %fp *after* it's been zero'd out. A
register long int sp asm("%sp"), fp asm("%fp");
foo ()
{
int a;
fp = 0;
a = ((int *)sp)[4];
return a;
}
You can't have an `auto' variable if there is no frame pointer to access
it off of.
I suggest adding `register' (or `static') to a's declaration. This solves
the problem very nicely.
Jim
wilson@cygnus.com
Technical Details
Message-ID:
<9204152353.AA08250@cygnus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!wilsonShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!wilson From: wilson@cygnus.com (Jim Wilson) Subject: Re: gcc 2.1 bug with frame ptr handling Message-ID: <9204152353.AA08250@cygnus.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Wed, 15 Apr 1992 23:53:55 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 21