tree-ssa-alias.c (create_name_tags): Use TYPE_VOLATILE instead of TREE_THIS_VOLATILE.
authorRichard Guenther <rguenther@suse.de>
Sat, 1 Sep 2007 09:07:17 +0000 (09:07 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 1 Sep 2007 09:07:17 +0000 (09:07 +0000)
2007-09-01  Richard Guenther  <rguenther@suse.de>

* tree-ssa-alias.c (create_name_tags): Use TYPE_VOLATILE
instead of TREE_THIS_VOLATILE.
* tree-ssa-operands.c (add_virtual_operand): Do not set
has_volatile_ops.  Do not check s_ann for NULL.
(get_indirect_ref_operands): Likewise.
(get_expr_operands): Likewise.  For all reference trees
set has_volatile_ops based on TREE_THIS_VOLATILE.  Also
check base of reference for TREE_THIS_VOLATILE.

From-SVN: r128012

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

index a90d832f6c6b6dcc5cb2c7c29c2b545bee6429db..9a267bf64bae1b042616e7f98ff2203b1754b28a 100644 (file)
@@ -1,3 +1,14 @@
+2007-09-01  Richard Guenther  <rguenther@suse.de>
+
+       * tree-ssa-alias.c (create_name_tags): Use TYPE_VOLATILE
+       instead of TREE_THIS_VOLATILE.
+       * tree-ssa-operands.c (add_virtual_operand): Do not set
+       has_volatile_ops.  Do not check s_ann for NULL.
+       (get_indirect_ref_operands): Likewise.
+       (get_expr_operands): Likewise.  For all reference trees
+       set has_volatile_ops based on TREE_THIS_VOLATILE.  Also
+       check base of reference for TREE_THIS_VOLATILE.
+
 2007-09-01  Richard Guenther  <rguenther@suse.de>
 
        * tree-cfg.c (verify_gimple_expr): Fix check for conversions
index 2dc23513af9a68e5b70d2e1c54a0bc02cad10c7a..52ca86b48df14d67600ab00067ffe05e868848b6 100644 (file)
@@ -2216,7 +2216,7 @@ create_name_tags (void)
 
       /* Inherit volatility from the pointed-to type.  */
       TREE_THIS_VOLATILE (pi->name_mem_tag)
-       |= TREE_THIS_VOLATILE (TREE_TYPE (TREE_TYPE (ptr)));
+       |= TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (ptr)));
       
       /* Mark the new name tag for renaming.  */
       mark_sym_for_renaming (pi->name_mem_tag);
index 7217b554ff0c6bc1aa4c4fcb4e0063d2dd9d1744..4996e09e8549602921b01a9f375b0b20358638e9 100644 (file)
@@ -1466,11 +1466,6 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
   /* Mark the statement as having memory operands.  */
   s_ann->references_memory = true;
 
-  /* Mark statements with volatile operands.  Optimizers should back
-     off from statements having volatile operands.  */
-  if (TREE_THIS_VOLATILE (sym) && s_ann)
-    s_ann->has_volatile_ops = true;
-
   /* If the variable cannot be modified and this is a VDEF change
      it into a VUSE.  This happens when read-only variables are marked
      call-clobbered and/or aliased to writable variables.  So we only
@@ -1499,7 +1494,7 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
 
   if (aliases == NULL)
     {
-      if (s_ann && !gimple_aliases_computed_p (cfun))
+      if (!gimple_aliases_computed_p (cfun))
         s_ann->has_volatile_ops = true;
 
       /* The variable is not aliased or it is an alias tag.  */
@@ -1630,7 +1625,7 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags,
   stmt_ann_t s_ann = stmt_ann (stmt);
 
   s_ann->references_memory = true;
-  if (s_ann && TREE_THIS_VOLATILE (expr))
+  if (TREE_THIS_VOLATILE (expr))
     s_ann->has_volatile_ops = true; 
 
   if (SSA_VAR_P (ptr))
@@ -1677,8 +1672,7 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags,
 
          /* Aliasing information is missing; mark statement as
             volatile so we won't optimize it out too actively.  */
-          else if (s_ann
-                  && !gimple_aliases_computed_p (cfun)
+          else if (!gimple_aliases_computed_p (cfun)
                    && (flags & opf_def))
             s_ann->has_volatile_ops = true;
        }
@@ -1688,8 +1682,7 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags,
       /* If a constant is used as a pointer, we can't generate a real
         operand for it but we mark the statement volatile to prevent
         optimizations from messing things up.  */
-      if (s_ann)
-       s_ann->has_volatile_ops = true;
+      s_ann->has_volatile_ops = true;
       return;
     }
   else
@@ -2121,6 +2114,9 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
        HOST_WIDE_INT offset, size, maxsize;
        bool none = true;
 
+       if (TREE_THIS_VOLATILE (expr))
+         s_ann->has_volatile_ops = true;
+
        /* This component reference becomes an access to all of the
           subvariables it can touch, if we can determine that, but
           *NOT* the real one.  If we can't determine which fields we
@@ -2148,8 +2144,10 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
            if (!none)
              flags |= opf_no_vops;
 
-           if (TREE_THIS_VOLATILE (expr))
-             get_stmt_ann (stmt)->has_volatile_ops = true;
+           if ((DECL_P (ref) && TREE_THIS_VOLATILE (ref))
+               || (TREE_CODE (ref) == SSA_NAME
+                   && TREE_THIS_VOLATILE (SSA_NAME_VAR (ref))))
+             s_ann->has_volatile_ops = true;
          }
        else if (TREE_CODE (ref) == INDIRECT_REF)
          {
@@ -2165,7 +2163,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
        
        if (code == COMPONENT_REF)
          {
-           if (s_ann && TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1)))
+           if (TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1)))
              s_ann->has_volatile_ops = true; 
            get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_use);
          }