From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20236 invoked by alias); 3 Jul 2012 09:56:49 -0000 Received: (qmail 20226 invoked by uid 22791); 3 Jul 2012 09:56:48 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Jul 2012 09:56:34 +0000 From: "mikpe at it dot uu.se" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53707] compiler generates wrong code Date: Tue, 03 Jul 2012 09:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mikpe at it dot uu.se X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-07/txt/msg00332.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #15 from Mikael Pettersson 2012-07-03 09:56:33 UTC --- Created attachment 27734 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27734 cleaned up test case This cleaned up version of the small C test case should be free of any technical problems, I hope. Gives the same result for -O2 and -O3 with 4.4.7, 4.5.4, 4.7.1, and 4.8.0 (all on x86_64-linux), but with 4.6.4 it returns different results for -O2 and -O3. Weirdly enough, changing the comparison operator from ">" to "<" makes 4.6.4 return the same result for both -O2 and -O3.