+2011-05-18 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/49018
+ * gimple.c (gimple_has_side_effects): Volatile asms have side-effects.
+ * tree-ssa-ifcombine.c (bb_no_side_effects_p): Use
+ gimple_has_side_effects.
+
2011-05-18 Richard Guenther <rguenther@suse.de>
* gimple.c (gimple_register_type_1): New function, split out from ...
if (gimple_has_volatile_ops (s))
return true;
+ if (gimple_code (s) == GIMPLE_ASM
+ && gimple_asm_volatile_p (s))
+ return true;
+
if (is_gimple_call (s))
{
unsigned nargs = gimple_call_num_args (s);
if (gimple_call_lhs (s)
&& TREE_SIDE_EFFECTS (gimple_call_lhs (s)))
{
- gcc_assert (gimple_has_volatile_ops (s));
+ gcc_checking_assert (gimple_has_volatile_ops (s));
return true;
}
for (i = 0; i < nargs; i++)
if (TREE_SIDE_EFFECTS (gimple_call_arg (s, i)))
{
- gcc_assert (gimple_has_volatile_ops (s));
+ gcc_checking_assert (gimple_has_volatile_ops (s));
return true;
}
else
{
for (i = 0; i < gimple_num_ops (s); i++)
- if (TREE_SIDE_EFFECTS (gimple_op (s, i)))
- {
- gcc_assert (gimple_has_volatile_ops (s));
- return true;
- }
+ {
+ tree op = gimple_op (s, i);
+ if (op && TREE_SIDE_EFFECTS (op))
+ {
+ gcc_checking_assert (gimple_has_volatile_ops (s));
+ return true;
+ }
+ }
}
return false;