]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-operands.c (add_call_clobber_ops): Use SFT_PARENT_VAR to try to avoid clobbe...
authorDaniel Berlin <dberlin@dberlin.org>
Thu, 12 Jan 2006 23:07:53 +0000 (23:07 +0000)
committerDaniel Berlin <dberlin@gcc.gnu.org>
Thu, 12 Jan 2006 23:07:53 +0000 (23:07 +0000)
2006-01-11  Daniel Berlin  <dberlin@dberlin.org>

* tree-ssa-operands.c (add_call_clobber_ops): Use SFT_PARENT_VAR
to try to avoid clobbering pieces of structures when we know
something about the whole structure.
* tree-ssa-alias.c (create_sft): Set SFT_PARENT_VAR

From-SVN: r109651

gcc/ChangeLog
gcc/tree-ssa-alias.c
gcc/tree-ssa-operands.c

index 0436ceaacbd3fea7fde3784f4046c0a74ac0e62b..014199f6dcd9aa11cd80e81acb3e28ccc86eb463 100644 (file)
@@ -1,3 +1,10 @@
+2006-01-11  Daniel Berlin  <dberlin@dberlin.org>
+
+       * tree-ssa-operands.c (add_call_clobber_ops): Use SFT_PARENT_VAR
+       to try to avoid clobbering pieces of structures when we know
+       something about the whole structure.
+       * tree-ssa-alias.c (create_sft): Set SFT_PARENT_VAR
+
 2006-01-13  Ben Elliston  <bje@au.ibm.com>
 
        * doc/rtl.texi (Insns): Remove statement that libcalls cannot
index cb5deade167a70d393d775152997209f99f905bd..212f58733bb123bbe0602101661a24e8247d2b86 100644 (file)
@@ -2536,6 +2536,7 @@ create_sft (tree var, tree field)
   ann = get_var_ann (subvar);
   ann->type_mem_tag = NULL;    
   add_referenced_tmp_var (subvar);
+  SFT_PARENT_VAR (subvar) = var;
 
   return subvar;
 }
index 24cd3644717860c453c671d1cdee750dbfc30cc0..6787dc2dc39648de2111bd610f31c3107971d927 100644 (file)
@@ -1778,14 +1778,25 @@ add_call_clobber_ops (tree stmt, tree callee)
   EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, u, bi)
     {
       tree var = referenced_var (u);
+      unsigned int uid = u;
+
       if (unmodifiable_var_p (var))
        add_stmt_operand (&var, &empty_ann, opf_none);
       else
        {
-         bool not_read
-           = not_read_b ? bitmap_bit_p (not_read_b, u) : false;
-         bool not_written
-           = not_written_b ? bitmap_bit_p (not_written_b, u) : false;
+         bool not_read;
+         bool not_written;
+         
+         /* Not read and not written are computed on regular vars, not
+            subvars, so look at the parent var if this is an SFT. */
+         
+         if (TREE_CODE (var) == STRUCT_FIELD_TAG)
+           uid = DECL_UID (SFT_PARENT_VAR (var));
+
+         not_read = 
+           not_read_b ? bitmap_bit_p (not_read_b, uid) : false;
+         not_written = 
+           not_written_b ? bitmap_bit_p (not_written_b, uid) : false;
 
          if (not_written)
            {