From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id E2B043858D28; Fri, 12 Aug 2022 11:37:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2B043858D28 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2031] tree-optimization/106593 - fix ICE with backward threading X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: f4ff20d464f90c85919ce2e7fa63e204dcda4e40 X-Git-Newrev: 4cc0d3ebaee4b54280ff0466d8e5b351a3b5bacc Message-Id: <20220812113746.E2B043858D28@sourceware.org> Date: Fri, 12 Aug 2022 11:37:46 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2022 11:37:47 -0000 https://gcc.gnu.org/g:4cc0d3ebaee4b54280ff0466d8e5b351a3b5bacc commit r13-2031-g4cc0d3ebaee4b54280ff0466d8e5b351a3b5bacc Author: Richard Biener Date: Fri Aug 12 12:20:13 2022 +0200 tree-optimization/106593 - fix ICE with backward threading With the last re-org I failed to make sure to not add SSA names nor supported by ranger into m_imports which then triggers an ICE in range_on_path_entry because range_of_expr returns false. PR tree-optimization/106593 * tree-ssa-threadbackward.cc (back_threader::find_paths): If the imports from the conditional do not satisfy gimple_range_ssa_p don't try to thread anything. Diff: --- gcc/tree-ssa-threadbackward.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/tree-ssa-threadbackward.cc b/gcc/tree-ssa-threadbackward.cc index 546a776bd91..b886027fccf 100644 --- a/gcc/tree-ssa-threadbackward.cc +++ b/gcc/tree-ssa-threadbackward.cc @@ -518,7 +518,11 @@ back_threader::find_paths (basic_block bb, tree name) bitmap_clear (m_imports); ssa_op_iter iter; FOR_EACH_SSA_TREE_OPERAND (name, stmt, iter, SSA_OP_USE) - bitmap_set_bit (m_imports, SSA_NAME_VERSION (name)); + { + if (!gimple_range_ssa_p (name)) + return; + bitmap_set_bit (m_imports, SSA_NAME_VERSION (name)); + } // Interesting is the set of imports we still not have see // the definition of. So while imports only grow, the