From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2467 invoked by alias); 17 Jan 2011 11:44:21 -0000 Received: (qmail 2458 invoked by uid 22791); 17 Jan 2011 11:44:20 -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; Mon, 17 Jan 2011 11:44:16 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/45967] [4.5 Regression] gcc-4.5.x optimizes code with side-effects away 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: alias, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.5.3 X-Bugzilla-Changed-Fields: Component Known to fail 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 Date: Mon, 17 Jan 2011 12:02:00 -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 X-SW-Source: 2011-01/txt/msg01629.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45967 Richard Guenther changed: What |Removed |Added ---------------------------------------------------------------------------- Component|rtl-optimization |tree-optimization Known to fail| |4.5.2 --- Comment #8 from Richard Guenther 2011-01-17 11:44:11 UTC --- The patch is quite big and a backport is nothing for the faint-hearted. Do not hold your breath. The underlying problem is present since ever btw, and 4.4 can be tricked into miscompiling with the usual avoid-empty-points-to-sets trick (conditionally assign (not) to the pointer, thus add something else to the set): extern void abort (void); int b; void foo (void *p_, int *q) { int *p; int i; for (i = 0; i < sizeof(int *); ++i) ((char *)&p)[i] = ((char *)p_)[i]; if (b) p = q; *p = 1; } int main() { int i = 0, j; int *p = &i; foo (&p, &j); if (i != 1) abort (); return 0; } I'll add some more testcases.