From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28959 invoked by alias); 23 May 2014 07:29:21 -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 28864 invoked by uid 48); 23 May 2014 07:29:14 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/61289] [4.9/4.10 Regression] Bad jump threading generates infinite loop Date: Fri, 23 May 2014 07:29: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-Version: 4.9.0 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.9.1 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc version target_milestone short_desc everconfirmed 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-05/txt/msg02054.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61289 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-05-23 CC| |jakub at gcc dot gnu.org Version|unknown |4.9.0 Target Milestone|--- |4.9.1 Summary|Bad jump threading |[4.9/4.10 Regression] Bad |generates infinite loop |jump threading generates | |infinite loop Ever confirmed|0 |1 --- Comment #2 from Jakub Jelinek --- struct S { inline int fn1 () const { return s; } __attribute__ ((noinline, noclone)) S *fn2 (int); __attribute__ ((noinline, noclone)) void fn3 (); __attribute__ ((noinline, noclone)) static S *fn4 (int); S (int i) : s (i) {} int s; }; int a = 0; S *b = 0; S * S::fn2 (int i) { a++; if (a == 1) return b; if (a > 3) __builtin_abort (); b = this; return new S (i + s); } S * S::fn4 (int i) { b = new S (i); return b; } void S::fn3 () { delete this; } void foo () { S *c = S::fn4 (20); for (int i = 0; i < 2;) { S *d = c->fn2 (c->fn1 () + 10); if (d != c) { c->fn3 (); c = d; ++i; } } c->fn3 (); } int main () { foo (); } Started with r205279.