]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-dfa.c (set_ssa_default_def): Clear the SSA_NAME_DEFAULT_DEF bit of the old name...
authorRichard Guenther <rguenther@suse.de>
Tue, 7 Aug 2012 14:16:11 +0000 (14:16 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 7 Aug 2012 14:16:11 +0000 (14:16 +0000)
2012-08-07  Richard Guenther  <rguenther@suse.de>

* tree-dfa.c (set_ssa_default_def): Clear the SSA_NAME_DEFAULT_DEF
bit of the old name when we clear the slot.
* tree-ssa-live.c (remove_unused_locals): Release any default
def associated with an unused var.
* tree-ssa-copy.c (may_propagate_copy_into_asm): Always return true.

From-SVN: r190201

gcc/ChangeLog
gcc/tree-dfa.c
gcc/tree-ssa-copy.c
gcc/tree-ssa-live.c

index 65f194aeb09f91e76709a5293c03066630b2e7dd..09103dab98d604a26a55e6cfca1775fe4d0347f5 100644 (file)
@@ -1,3 +1,11 @@
+2012-08-07  Richard Guenther  <rguenther@suse.de>
+
+       * tree-dfa.c (set_ssa_default_def): Clear the SSA_NAME_DEFAULT_DEF
+       bit of the old name when we clear the slot.
+       * tree-ssa-live.c (remove_unused_locals): Release any default
+       def associated with an unused var.
+       * tree-ssa-copy.c (may_propagate_copy_into_asm): Always return true.
+
 2012-08-07  Richard Guenther  <rguenther@suse.de>
 
        * tree-into-ssa.c (rewrite_stmt): Remove clobbers for variables
index 12bb577df5e275319642666fe811bdd805c88f15..5342f1973a411fcd7681a543bb9c81bd90c9aebb 100644 (file)
@@ -336,7 +336,10 @@ set_ssa_default_def (struct function *fn, tree var, tree def)
       loc = htab_find_slot_with_hash (DEFAULT_DEFS (fn), &in,
                                      DECL_UID (var), NO_INSERT);
       if (*loc)
-       htab_clear_slot (DEFAULT_DEFS (fn), loc);
+       {
+         SSA_NAME_IS_DEFAULT_DEF (*(tree *)loc) = false;
+         htab_clear_slot (DEFAULT_DEFS (fn), loc);
+       }
       return;
     }
   gcc_assert (TREE_CODE (def) == SSA_NAME && SSA_NAME_VAR (def) == var);
@@ -349,7 +352,7 @@ set_ssa_default_def (struct function *fn, tree var, tree def)
 
    /* Mark DEF as the default definition for VAR.  */
   *(tree *) loc = def;
-   SSA_NAME_IS_DEFAULT_DEF (def) = true;
+  SSA_NAME_IS_DEFAULT_DEF (def) = true;
 }
 
 /* Retrieve or create a default definition for VAR.  */
index 7686dda1fbdb86f4d4e0cbb1b3591a300c4c9628..c5fe156ce9ae6853c03a175540a68c2ee1b8660b 100644 (file)
@@ -137,12 +137,9 @@ may_propagate_copy_into_stmt (gimple dest, tree orig)
 /* Similarly, but we know that we're propagating into an ASM_EXPR.  */
 
 bool
-may_propagate_copy_into_asm (tree dest)
+may_propagate_copy_into_asm (tree dest ATTRIBUTE_UNUSED)
 {
-  /* Hard register operands of asms are special.  Do not bypass.  */
-  return !(TREE_CODE (dest) == SSA_NAME
-          && TREE_CODE (SSA_NAME_VAR (dest)) == VAR_DECL
-          && DECL_HARD_REGISTER (SSA_NAME_VAR (dest)));
+  return true;
 }
 
 
index 903faa9164907a492806758b0b02b2010d16eef7..3edda1e378e1cca44beaee56887580bc6a9e0faa 100644 (file)
@@ -798,9 +798,16 @@ remove_unused_locals (void)
        {
          if (!is_used_p (var))
            {
+             tree def;
              if (cfun->nonlocal_goto_save_area
                  && TREE_OPERAND (cfun->nonlocal_goto_save_area, 0) == var)
                cfun->nonlocal_goto_save_area = NULL;
+             /* Release any default def associated with var.  */
+             if ((def = ssa_default_def (cfun, var)) != NULL_TREE)
+               {
+                 set_ssa_default_def (cfun, var, NULL_TREE);
+                 release_ssa_name (def);
+               }
              continue;
            }
        }