This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR45052
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 26 Jul 2010 11:27:24 +0200 (CEST)
- Subject: [PATCH] Fix PR45052
We need to look at the stmts volatile flag.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2010-07-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45052
* ipa-pure-const.c (check_stmt): Check volatileness.
Index: gcc/ipa-pure-const.c
===================================================================
*** gcc/ipa-pure-const.c (revision 162057)
--- gcc/ipa-pure-const.c (working copy)
*************** check_stmt (gimple_stmt_iterator *gsip,
*** 416,421 ****
--- 416,428 ----
print_gimple_stmt (dump_file, stmt, 0, 0);
}
+ if (gimple_has_volatile_ops (stmt))
+ {
+ local->pure_const_state = IPA_NEITHER;
+ if (dump_file)
+ fprintf (dump_file, " Volatile stmt is not const/pure\n");
+ }
+
/* Look for loads and stores. */
walk_stmt_load_store_ops (stmt, local, check_load, check_store);