From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10613 invoked by alias); 28 Feb 2012 09:54:47 -0000 Received: (qmail 10604 invoked by uid 22791); 28 Feb 2012 09:54:46 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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; Tue, 28 Feb 2012 09:54:34 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/52406] [4.7 Regression] likely wrong code bug Date: Tue, 28 Feb 2012 09:59: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 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-02/txt/msg02672.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52406 --- Comment #2 from Jakub Jelinek 2012-02-28 09:54:01 UTC --- Strangely, /* PR tree-optimization/52406 */ extern void abort (void); struct { int f1; } a[2]; int *b, *const k = &a[1].f1; static int **c = &b; int e, f, d; int main () { int **l = &b; *l = k; for (; d <= 0; d++) { int *j = &e; **c = 1; *l = k; *k ^= 0; f = **l; *j = f; } if (e != 1) abort (); return 0; } fails, but with --- pr52406.c 2012-02-28 10:47:45.663204390 +0100 +++ pr52406.c 2012-02-28 10:47:56.695143490 +0100 @@ -1,9 +1,9 @@ /* PR tree-optimization/52406 */ extern void abort (void); -struct { int f1; } a[2]; +int a[2]; -int *b, *const k = &a[1].f1; +int *b, *const k = &a[1]; static int **c = &b; int e, f, d; it works (IL starts to differ during pcom), beyond the &a[1] vs. &a[1].f1 changes. So even if there isn't a wrong code, there would be at least missed-optimization.