diff options
author | Josh Conner <jconner@apple.com> | 2005-08-26 22:42:44 +0000 |
---|---|---|
committer | Josh Conner <jconner@gcc.gnu.org> | 2005-08-26 22:42:44 +0000 |
commit | 1b0d2d1789a669d5dfcb5fa7760ff9fb70dc72c2 (patch) | |
tree | 531275faa3f621ba950fe04ea5a8e2a0b7cdaca9 /gcc/ipa-pure-const.c | |
parent | 24b7d7c318e883bedd854414ae4348cda673f8ad (diff) | |
download | gcc-1b0d2d1789a669d5dfcb5fa7760ff9fb70dc72c2.zip gcc-1b0d2d1789a669d5dfcb5fa7760ff9fb70dc72c2.tar.gz gcc-1b0d2d1789a669d5dfcb5fa7760ff9fb70dc72c2.tar.bz2 |
re PR tree-optimization/23584 (ipa-pure-const pass ignores dereferencing a volatile pointer type)
PR middle-end/23584
* ipa-pure-const.c (check_tree): Check for volatile-ness
when considering a dereference.
From-SVN: r103546
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r-- | gcc/ipa-pure-const.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 0b659a0..c603831 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -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 - 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; - 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)) |