This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/8832: [<3.2,3.3> regression] traditional "asm volatile" code is illegally optimized
- From: ehrhardt at mathematik dot uni-ulm dot de
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, mark at cal005304 dot student dot utwente dot nl, nobody at gcc dot gnu dot org
- Date: 6 Dec 2002 12:11:08 -0000
- Subject: Re: optimization/8832: [<3.2,3.3> regression] traditional "asm volatile" code is illegally optimized
- Reply-to: ehrhardt at mathematik dot uni-ulm dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, mark at cal005304 dot student dot utwente dot nl, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: "asm volatile" code is removed
New Synopsis: [<3.2,3.3> regression] traditional "asm volatile" code is illegally optimized
State-Changed-From-To: open->analyzed
State-Changed-By: cae
State-Changed-When: Fri Dec 6 04:11:08 2002
State-Changed-Why:
I can confirm this with 3.3 on sparc, i.e. it isn't arch independant.
These two pieces of code produce the same assembler output (except for
label names) which looks like a bug to me. 3.2.1-prerelease is even
worse: It completly eliminates two of the volatile asm statements.
Comile with -O3 -S
Priority high because this is a regression from 2.95.3
----------------- variant 1 -------------------------
void f (int v)
{
asm volatile ("blah p0, p1" );
if (v&7) {
asm volatile ("blub p0, p1" );
}
asm volatile ("foo p0, p1");
if (v&7) {
asm volatile ("bar p0, p1" );
}
asm volatile ("baz p0, p1" );
}
----------------- end --------------------------
----------------- variant 2 -------------------------
void f (int v)
{
asm volatile ("blah p0, p1" );
if (v&7) {
asm volatile ("blub p0, p1" );
asm volatile ("foo p0, p1");
asm volatile ("bar p0, p1" );
}
asm volatile ("baz p0, p1" );
}
----------------- end --------------------------
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8832