re PR middle-end/49893 (-O3 generates wrong code for volatile)
authorRichard Guenther <rguenther@suse.de>
Fri, 29 Jul 2011 09:54:23 +0000 (09:54 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 29 Jul 2011 09:54:23 +0000 (09:54 +0000)
2011-07-29  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/49893
* tree-predcom.c (suitable_reference_p): Volatile references
are not suitable.

From-SVN: r176921

gcc/ChangeLog
gcc/tree-predcom.c

index 2d12436df0c40fb3f41ea8da62e5491a846b7882..5653050796b3f8c53c8dc73e90fa966c28e55d97 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-29  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/49893
+       * tree-predcom.c (suitable_reference_p): Volatile references
+       are not suitable.
+
 2011-07-29  Georg-Johann Lay  <avr@gjlay.de>
        
        PR target/49313
index 94b0512bdafda5b0661fd63546a95776c22d9fde..ac2314778a809b686bdcb923e7e5046724905699 100644 (file)
@@ -598,6 +598,7 @@ suitable_reference_p (struct data_reference *a, enum ref_step_type *ref_step)
   tree ref = DR_REF (a), step = DR_STEP (a);
 
   if (!step
+      || TREE_THIS_VOLATILE (ref)
       || !is_gimple_reg_type (TREE_TYPE (ref))
       || tree_could_throw_p (ref))
     return false;