From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1802 invoked by alias); 16 Oct 2011 14:40:48 -0000 Received: (qmail 1787 invoked by uid 22791); 16 Oct 2011 14:40:47 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Sun, 16 Oct 2011 14:40:33 +0000 From: "mans at mansr dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/49140] [4.6 regression] wrong code with -O2 and -O3, not with -O3 -no-inline Date: Sun, 16 Oct 2011 14:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: major X-Bugzilla-Who: mans at mansr dot com X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.2 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: 2011-10/txt/msg01538.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49140 --- Comment #23 from Mans Rullgard 2011-10-16 14:40:29 UTC --- Created attachment 25516 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25516 Small test case with invalid code exhibiting the problem Here's a small test case with invalid code showing the problem with several gcc versions going back at least to 4.5. Compiling with -fno-tree-pta makes it behave as "expected". I do not believe the compiler to be at fault here. PARI is clearly full of undefined behaviours they really ought to fix rather than complain that doing so would change the ABI and blame the compiler which is only doing a good job following the spec.