optimization/10684: register variable update disappears when using -O
ehrhardt@mathematik.uni-ulm.de
ehrhardt@mathematik.uni-ulm.de
Thu May 8 18:56:00 GMT 2003
Synopsis: register variable update disappears when using -O
State-Changed-From-To: open->analyzed
State-Changed-By: cae
State-Changed-When: Thu May 8 18:52:25 2003
State-Changed-Why:
Confirmed, still present in 3.4-cvs. This is a reduced testcase:
register int STACK __asm__("%ebx");
static void (*p) ();
void f ()
{
STACK += 1;
p ();
STACK -= 1;
}
Looking at the assembly shows that STACK += 1 ist lost if compiled
with -O. The problem seems to be that life analysis adds a REG_DEAD
note to the call to (*p) which makes STACK += 1 a dead store.
regards Christian
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10684
More information about the Gcc-bugs
mailing list