From: Andrew MacLeod Date: Tue, 1 Nov 2022 17:18:33 +0000 (-0400) Subject: Make sure ssa-name is valid. X-Git-Tag: basepoints/gcc-14~3610 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82b0345f6137b112728590d7c010dcd2cef08514;p=thirdparty%2Fgcc.git Make sure ssa-name is valid. PR tree-optimization/107497 * tree-vrp.cc (remove_unreachable::remove_and_update_globals): Check that ssa-name still exists before accessing it. --- diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc index f0e4d37bef09..39f7eb7a75ec 100644 --- a/gcc/tree-vrp.cc +++ b/gcc/tree-vrp.cc @@ -180,7 +180,7 @@ remove_unreachable::remove_and_update_globals (bool final_p) bitmap_copy (dce, all_exports); // Don't attempt to DCE parameters. EXECUTE_IF_SET_IN_BITMAP (all_exports, 0, i, bi) - if (SSA_NAME_IS_DEFAULT_DEF (ssa_name (i))) + if (!ssa_name (i) || SSA_NAME_IS_DEFAULT_DEF (ssa_name (i))) bitmap_clear_bit (dce, i); simple_dce_from_worklist (dce);