From: Richard Biener Date: Fri, 12 Aug 2022 10:20:13 +0000 (+0200) Subject: tree-optimization/106593 - fix ICE with backward threading X-Git-Tag: basepoints/gcc-14~5176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cc0d3ebaee4b54280ff0466d8e5b351a3b5bacc;p=thirdparty%2Fgcc.git 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 --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