From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3437 invoked by alias); 6 Dec 2002 12:11:09 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3377 invoked by uid 61); 6 Dec 2002 12:11:08 -0000 Date: Fri, 06 Dec 2002 04:11:00 -0000 Message-ID: <20021206121108.3376.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, mark@cal005304.student.utwente.nl, nobody@gcc.gnu.org From: ehrhardt@mathematik.uni-ulm.de Reply-To: ehrhardt@mathematik.uni-ulm.de, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, mark@cal005304.student.utwente.nl, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: optimization/8832: [<3.2,3.3> regression] traditional "asm volatile" code is illegally optimized X-SW-Source: 2002-12/txt/msg00350.txt.bz2 List-Id: 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