From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A3797385842D; Tue, 21 Feb 2023 19:29:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3797385842D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677007794; bh=F4OqCtYl3MlDC+wH1RylMcWUgppg1l0wOSyLHKQKo1U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gPsKA7I9iib3PNibrrJgsX+soj+pCyM2TRQ5QuMryacQYt2hmu95AJFpzLgo37dDy 9IS2adzIwy5rt3Pjc8Vl3x6ykFEP1aGR1fQdh2wcLl+rVb8rjIuIikWOwjE1ky+Jgl jB9Dzmp+ZeCe+J6dLCZbsRAR/TvCa7Iv3JWbqREQ= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/106041] [12/13 Regression] infinite loop in fast_dce at -O1 with aarch64 Date: Tue, 21 Feb 2023 19:29:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: compile-time-hog, needs-bisection, needs-reduction X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106041 --- Comment #11 from Richard Biener --- Created attachment 54503 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54503&action=3Dedit reduced testcase Reduced testcase (on the GCC 12 branch). Reduced with -O1 and diff --git a/gcc/dce.cc b/gcc/dce.cc index 6676cbcd429..8af54a96394 100644 --- a/gcc/dce.cc +++ b/gcc/dce.cc @@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "dbgcnt.h" #include "rtl-iter.h" +#include "diagnostic-core.h" /* -----------------------------------------------------------------------= -- @@ -1103,9 +1104,13 @@ fast_dce (bool word_level) dead_debug_global_init (&global_debug, NULL); + unsigned iters =3D 0; while (global_changed) { global_changed =3D false; + ++iters; + if (iters > 50) + internal_error ("too many iterations"); for (i =3D 0; i < n_blocks; i++) {=