🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Jim Wilson Wed, 15 Apr 1992 23:53
Re: gcc 2.1 bug with frame ptr handling
#432
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads