Hi!

As discussed in the PR, SSA_NAME ={v} {CLOBBER} stmts are undesirable
at least for the debug info, we really don't need to mark there the end
of scope in the IL, the debug info records the ranges of the scopes
and if the clobber gets scheduled before some insn we get unnecessarily
pessimistic debug info.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
ok for trunk?

2011-11-28  Jakub Jelinek  <ja...@redhat.com>

        PR debug/50317
        * tree-ssa.c (execute_update_addresses_taken): Remove
        var ={v} {CLOBBER} stmts instead of rewriting them into
        var_N ={v} {CLOBBER}.

--- gcc/tree-ssa.c.jj   2011-10-14 08:21:56.000000000 +0200
+++ gcc/tree-ssa.c      2011-11-28 13:29:45.297956952 +0100
@@ -2118,7 +2118,7 @@ execute_update_addresses_taken (void)
   if (update_vops)
     {
       FOR_EACH_BB (bb)
-       for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+       for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
          {
            gimple stmt = gsi_stmt (gsi);
 
@@ -2159,6 +2159,18 @@ execute_update_addresses_taken (void)
                if (gimple_assign_lhs (stmt) != lhs)
                  gimple_assign_set_lhs (stmt, lhs);
 
+               /* For var ={v} {CLOBBER}; where var lost
+                  TREE_ADDRESSABLE just remove the stmt.  */
+               if (DECL_P (lhs)
+                   && TREE_CLOBBER_P (rhs)
+                   && symbol_marked_for_renaming (lhs))
+                 {
+                   unlink_stmt_vdef (stmt);
+                   gsi_remove (&gsi, true);
+                   release_defs (stmt);
+                   continue;
+                 }
+
                if (gimple_assign_rhs1 (stmt) != rhs)
                  {
                    gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
@@ -2205,6 +2219,8 @@ execute_update_addresses_taken (void)
            if (gimple_references_memory_p (stmt)
                || is_gimple_debug (stmt))
              update_stmt (stmt);
+
+           gsi_next (&gsi);
          }
 
       /* Update SSA form here, we are called as non-pass as well.  */

        Jakub

Reply via email to