re PR tree-optimization/60770 (disappearing clobbers)
[gcc.git] / gcc / tree-ssa-live.c
index 1effb43bd380259faa8350a99939675edff618c3..22013e0ccdfb657d34ee391ad16b66c1935ee5a9 100644 (file)
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic-core.h"
 #include "debug.h"
 #include "flags.h"
+#include "tree-ssa.h"
 
 #ifdef ENABLE_CHECKING
 static void  verify_live_on_entry (tree_live_info_p);
@@ -1103,6 +1104,10 @@ set_var_live_on_entry (tree ssa_name, tree_live_info_p live)
   else
     def_bb = ENTRY_BLOCK_PTR_FOR_FN (cfun);
 
+  /* An undefined local variable does not need to be very alive.  */
+  if (ssa_undefined_value_p (ssa_name, false))
+    return;
+
   /* Visit each use of SSA_NAME and if it isn't in the same block as the def,
      add it to the list of live on entry blocks.  */
   FOR_EACH_IMM_USE_FAST (use, imm_iter, ssa_name)
@@ -1439,6 +1444,11 @@ verify_live_on_entry (tree_live_info_p live)
          else
            if (d == var)
              {
+               /* An undefined local variable does not need to be very
+                  alive.  */
+               if (ssa_undefined_value_p (var, false))
+                 continue;
+
                /* The only way this var shouldn't be marked live on entry is
                   if it occurs in a PHI argument of the block.  */
                size_t z;