This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/10684: register variable update disappears when using -O
- From: ehrhardt at mathematik dot uni-ulm dot de
- To: Joerg-Cyril dot Hoehle at T-Systems dot com, bruno at clisp dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, sds at gnu dot org
- Date: 8 May 2003 18:52:26 -0000
- Subject: Re: optimization/10684: register variable update disappears when using -O
- Reply-to: ehrhardt at mathematik dot uni-ulm dot de, Joerg-Cyril dot Hoehle at T-Systems dot com, bruno at clisp dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, sds at gnu dot org, gcc-gnats at gcc dot gnu dot org
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