This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: optimization/8832: [<3.2,3.3> regression] traditional "asm volatile" code is illegally optimized


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]