summaryrefslogtreecommitdiff
path: root/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r--gcc/ipa-pure-const.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 1ff15bf22e6..0e07e448295 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -651,6 +651,13 @@ 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))
+ {
+ 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,
ipa ? check_ipa_load : check_load,