ipa-pure-const.c (check_stmt): Clobbers do not make a function non-const/pure.
authorRichard Guenther <rguenther@suse.de>
Fri, 27 Jan 2012 15:49:34 +0000 (15:49 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 27 Jan 2012 15:49:34 +0000 (15:49 +0000)
2012-01-27  Richard Guenther  <rguenther@suse.de>

* ipa-pure-const.c (check_stmt): Clobbers do not make a
function non-const/pure.

From-SVN: r183632

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

index 009203b51b24060d65a834bd1aed15698f24f11e..60bc0a9ae3b37c5df407939d34c53b23ab02b721 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-27  Richard Guenther  <rguenther@suse.de>
+
+       * ipa-pure-const.c (check_stmt): Clobbers do not make a
+       function non-const/pure.
+
 2012-01-27  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/50444
index 82e24cf5a015a2dc426839c01caa3a2ea9bc559d..e8b21f9fc6b6802a7dd78a3baaa68c5778afad18 100644 (file)
@@ -652,7 +652,8 @@ check_stmt (gimple_stmt_iterator *gsip, funct_state local, bool ipa)
       print_gimple_stmt (dump_file, stmt, 0, 0);
     }
 
-  if (gimple_has_volatile_ops (stmt))
+  if (gimple_has_volatile_ops (stmt)
+      && !gimple_clobber_p (stmt))
     {
       local->pure_const_state = IPA_NEITHER;
       if (dump_file)