/* 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))
/* Get rid of the aux information. */
if (node->aux)
{
+ w_info = node->aux;
+ if (w_info->aux)
+ free (w_info->aux);
free (node->aux);
node->aux = NULL;
}
struct tree_opt_pass pass_ipa_pure_const =
{
- "ipa-pure-const", /* name */
+ "pure-const", /* name */
gate_pure_const, /* gate */
static_execute, /* execute */
NULL, /* sub */