From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 341A7385840D; Tue, 9 Apr 2024 09:47:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 341A7385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712656036; bh=LE6o67mQDHpU+tjqbYc1Su0fadamCQF0+9Nmqi7U7p4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HqfoJJwZkZMI38bTPvo/mjBJY0y+T3DAaEbDNao3uLIgP4B1crzJa6eQNozU3XSyE 640+wfC2+ONLjEAcuTXMGeLZQ4qObHNXwxwCZ98QYpSzYrwF32jzLjAw2b26nZacsz 3yWtd7j8clEV48Pu2j6T/u4SwCrhF76MSiIX6ywc= From: "mikael at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111293] [14 Regression] Missed Dead Code Elimination since r14-3414-g0cfc9c953d0 Date: Tue, 09 Apr 2024 09:47:14 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: mikael at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D111293 --- Comment #4 from Mikael Morin --- For what's worth adding -fno-tree-vrp "fixes" this and enables removal of t= he call to 'foo' with trunk. Here is a minimal revert of the regressing revision, but it may just make t= he problem latent. diff --git a/gcc/gimple-range-phi.cc b/gcc/gimple-range-phi.cc index 01900a35b32..9fa9fe83ce0 100644 --- a/gcc/gimple-range-phi.cc +++ b/gcc/gimple-range-phi.cc @@ -386,14 +386,6 @@ phi_analyzer::process_phi (gphi *phi) m_work.safe_push (arg); continue; } - // More than 2 outside names is too complicated. - if (m_num_extern >=3D 2) - { - cycle_p =3D false; - break; - } - m_external[m_num_extern] =3D arg; - m_ext_edge[m_num_extern++] =3D gimple_phi_arg_edge (phi_stmt,= x); } else if (code =3D=3D INTEGER_CST) { @@ -402,12 +394,15 @@ phi_analyzer::process_phi (gphi *phi) wi::to_wide (arg)); init_range.union_ (val); } - else + // More than 2 outside names/CONST is too complicated. + if (m_num_extern >=3D 2) { - // Everything else terminates the cycle. cycle_p =3D false; break; } + + m_external[m_num_extern] =3D arg; + m_ext_edge[m_num_extern++] =3D gimple_phi_arg_edge (phi_stmt, x); } }=