OSDN Git Service

PR middle-end/23584
authorjconner <jconner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Aug 2005 22:42:44 +0000 (22:42 +0000)
committerjconner <jconner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Aug 2005 22:42:44 +0000 (22:42 +0000)
        * ipa-pure-const.c (check_tree): Check for volatile-ness
        when considering a dereference.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103546 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ipa-pure-const.c

index b2643c2..cc3117c 100644 (file)
@@ -1,3 +1,9 @@
+2005-08-26  Josh Conner  <jconner@apple.com>
+
+       PR middle-end/23584
+       * ipa-pure-const.c (check_tree): Check for volatile-ness
+       when considering a dereference.
+
 2005-08-27  Jakub Jelinek  <jakub@redhat.com>
 
        * rtl.h (MEM_IN_STRUCT_P): Fix comment typo.
 2005-08-27  Jakub Jelinek  <jakub@redhat.com>
 
        * rtl.h (MEM_IN_STRUCT_P): Fix comment typo.
index 0b659a0..c603831 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
       
       /* 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;
        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))
     }
 
   if (SSA_VAR_P (t))