🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #432

Re: gcc 2.1 bug with frame ptr handling

#432
From: Jim Wilson
Date: Wed, 15 Apr 1992 23:53
20 lines
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!wilson

Show 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