Commit 1b0d2d17 by Josh Conner Committed by Josh Conner

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
parent 24b7d7c3
2005-08-26 Josh Conner <jconner@apple.com>
PR middle-end/23584
* ipa-pure-const.c (check_tree): Check for volatile-ness
when considering a dereference.
2005-08-27 Jakub Jelinek <jakub@redhat.com> 2005-08-27 Jakub Jelinek <jakub@redhat.com>
* rtl.h (MEM_IN_STRUCT_P): Fix comment typo. * rtl.h (MEM_IN_STRUCT_P): Fix comment typo.
......
...@@ -182,13 +182,14 @@ check_tree (funct_state local, tree t, bool checking_write) ...@@ -182,13 +182,14 @@ check_tree (funct_state local, tree t, bool checking_write)
/* Any indirect reference that occurs on the lhs /* Any indirect reference that occurs on the lhs
disqualifies the function from being pure or const. Any disqualifies the function from being pure or const. Any
indirect reference that occurs on the rhs disqualifies indirect reference to a volatile disqualifies the
the function from being const. */ function from being pure or const. Any indirect
if (checking_write) 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; local->pure_const_state = IPA_NEITHER;
else else if (local->pure_const_state == IPA_CONST)
if (local->pure_const_state == IPA_CONST) local->pure_const_state = IPA_PURE;
local->pure_const_state = IPA_PURE;
} }
if (SSA_VAR_P (t)) if (SSA_VAR_P (t))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment