aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-05-18 13:33:21 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-05-18 13:33:21 +0000
commit179184e3e58fdf0334e255600022f93d20f5eed7 (patch)
tree7bb48622e83ba6ee867af98f7b86d6ffdc4a9d58 /gcc/gimple.c
parent93b2a207a64567029fcb6e7543fb25bbc00feb19 (diff)
downloadgcc-179184e3e58fdf0334e255600022f93d20f5eed7.zip
gcc-179184e3e58fdf0334e255600022f93d20f5eed7.tar.gz
gcc-179184e3e58fdf0334e255600022f93d20f5eed7.tar.bz2
re PR tree-optimization/49018 (Inline assembly block executed outside conditional check with "-O1 -ftree-vrp")
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. From-SVN: r173861
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index cd57d5b..3bf369a 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2354,6 +2354,10 @@ gimple_has_side_effects (const_gimple s)
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);
@@ -2368,7 +2372,7 @@ gimple_has_side_effects (const_gimple 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;
}
@@ -2379,7 +2383,7 @@ gimple_has_side_effects (const_gimple s)
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;
}
@@ -2388,11 +2392,14 @@ gimple_has_side_effects (const_gimple s)
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;