public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/8832: [<3.2,3.3> regression] traditional "asm volatile" code is illegally optimized
@ 2002-12-06  4:11 ehrhardt
  0 siblings, 0 replies; only message in thread
From: ehrhardt @ 2002-12-06  4:11 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mark, nobody

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-12-06 12:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-06  4:11 optimization/8832: [<3.2,3.3> regression] traditional "asm volatile" code is illegally optimized ehrhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).