]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Make sure ssa-name is valid.
authorAndrew MacLeod <amacleod@redhat.com>
Tue, 1 Nov 2022 17:18:33 +0000 (13:18 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Tue, 1 Nov 2022 17:31:06 +0000 (13:31 -0400)
PR tree-optimization/107497
* tree-vrp.cc (remove_unreachable::remove_and_update_globals):
Check that ssa-name still exists before accessing it.

gcc/tree-vrp.cc

index f0e4d37bef094a7b6da3205fb8cf50aecbcfb632..39f7eb7a75ec7b4fc0903cb962decceeeced5c54 100644 (file)
@@ -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);