From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30417 invoked by alias); 10 Mar 2014 10:42:04 -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 30355 invoked by uid 48); 10 Mar 2014 10:41:59 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/60429] [4.7/4.8/4.9 Regression] Miscompilation (aliasing) with -finline-functions Date: Mon, 10 Mar 2014 10:42:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.4 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-03/txt/msg00755.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60429 --- Comment #18 from Richard Biener --- Seems to be a PTA issue: InsertionSort_pETEchase.29_82, points-to vars: { } InsertionSort_pETEchase.29_86, points-to non-local, points-to escaped, points-to vars: { } p1_155, points-to NULL, points-to vars: { } : InsertionSort_pETEchase.29_82->next = p1_84; p1_155->next = InsertionSort_pETEchase.28_85; InsertionSort_pETEchase.29_86 = InsertionSort_pETEchase.28_85->back; InsertionSort_pETEchase.29_86->next = p1_155; p1_155->back = &InsertionSort_pETEchaseBackTMP; taking _155 as example # p1_155 = PHI <_35(57), p1_58(60)> _35, points-to NULL, points-to vars: { } p1_58, points-to vars: { } _35 = MEM[(struct _EdgeTableEntry * *)&AET + 16B]; # p1_58 = PHI p1_84 = p1_155->next; p1_87 = p1_155->next; so it's a cycle seeded only by MEM[(struct _EdgeTableEntry * *)&AET + 16B]; _35 = { NULL } same as AET.128+64 _35 = AET.128+64 # p1_150 = PHI <&AET(47), p1_151(49)> # p1_151 = PHI p1_45 = p1_151->next; fn3_tmp = p1_45; p1_151->next = p1_47; p1_151->back = p1_150; p1_150 = &AET.0+96 *p1_150 + 128 = p1_151 Note that valgrind shows loads of errors (with the reduced testcase at least) that show invalid reads and writes even at -O0. So we may just optimistically optimize based on that undefined behavior. At least I can't see anything wrong with what PTA derives ...