From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 502 invoked by alias); 5 Feb 2014 15:43:09 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 455 invoked by uid 48); 5 Feb 2014 15:43:06 -0000 From: "su at cs dot ucdavis.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/60062] [4.7/4.9 Regression] wrong code (for code with the optimize attribute) at -O1 and above on x86_64-linux-gnu in 32-bit mode Date: Wed, 05 Feb 2014 15:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: su at cs dot ucdavis.edu X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg00448.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60062 --- Comment #5 from Zhendong Su --- (In reply to Jakub Jelinek from comment #4) > *** Bug 60072 has been marked as a duplicate of this bug. *** The testcase below is most likely another dup as the only difference is that it affects the trunk at -Os only. Just include it here for reference. Thanks. ---------------------------------- int printf (const char *, ...); int a; int fn1 (unsigned char p1) { return p1 % p1; } static void fn2 (char *p1, int p2) { if (p2) printf (p1); } __attribute__ ((optimize (0))) int fn3 (short p1, short p2) { a = 0; return 0; } __attribute__ ((optimize (1))) int fn4 () { fn3 (0, 0); if (fn1 (1)) for (;;) ; return 1; } __attribute__ ((optimize (0))) int main () { fn4 (); fn2 ("", 0); return 0; }