OSDN Git Service

2005-12-16 Paolo Bonzini <bonzini@gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / ipa-pure-const.c
index 0b659a0..23a7685 100644 (file)
@@ -182,13 +182,14 @@ check_tree (funct_state local, tree t, bool checking_write)
       
       /* Any indirect reference that occurs on the lhs
         disqualifies the function from being pure or const. Any
-        indirect reference that occurs on the rhs disqualifies
-        the function from being const.  */
-      if (checking_write) 
+        indirect reference to a volatile disqualifies the
+        function from being pure or const.  Any indirect
+        reference that occurs on the rhs disqualifies the
+        function from being const.  */
+      if (checking_write || TREE_THIS_VOLATILE (t)) 
        local->pure_const_state = IPA_NEITHER;
-      else 
-       if (local->pure_const_state == IPA_CONST)
-         local->pure_const_state = IPA_PURE;
+      else if (local->pure_const_state == IPA_CONST)
+       local->pure_const_state = IPA_PURE;
     }
 
   if (SSA_VAR_P (t))
@@ -694,6 +695,9 @@ static_execute (void)
     /* Get rid of the aux information.  */
     if (node->aux)
       {
+       w_info = node->aux;
+       if (w_info->aux)
+         free (w_info->aux);
        free (node->aux);
        node->aux = NULL;
       }
@@ -711,7 +715,7 @@ gate_pure_const (void)
 
 struct tree_opt_pass pass_ipa_pure_const =
 {
-  "ipa-pure-const",                    /* name */
+  "pure-const",                                /* name */
   gate_pure_const,                     /* gate */
   static_execute,                      /* execute */
   NULL,                                        /* sub */