diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-04-09 13:23:51 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-04-09 13:23:51 +0200 |
commit | f55460af163cc791a59bed42aa8f152417150a7e (patch) | |
tree | 278ad08deaf680f882d21d74af54385c37e7b401 /gcc/tree-ssa-ifcombine.c | |
parent | 0b77bbf392d30d1b9335c329131c4d7ce476a15f (diff) | |
download | gcc-f55460af163cc791a59bed42aa8f152417150a7e.zip gcc-f55460af163cc791a59bed42aa8f152417150a7e.tar.gz gcc-f55460af163cc791a59bed42aa8f152417150a7e.tar.bz2 |
re PR tree-optimization/70586 (wrong code at -O2 and -O3 on x86_64-linux-gnu in 32-bit and 64-bit modes)
PR tree-optimization/70586
* tree-ssa-ifcombine.c (bb_no_side_effects_p): Return false
for any calls.
* gcc.c-torture/execute/pr70586.c: New test.
From-SVN: r234849
Diffstat (limited to 'gcc/tree-ssa-ifcombine.c')
-rw-r--r-- | gcc/tree-ssa-ifcombine.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c index 22b8b78..79fe3a8 100644 --- a/gcc/tree-ssa-ifcombine.c +++ b/gcc/tree-ssa-ifcombine.c @@ -125,7 +125,14 @@ bb_no_side_effects_p (basic_block bb) if (gimple_has_side_effects (stmt) || gimple_uses_undefined_value_p (stmt) || gimple_could_trap_p (stmt) - || gimple_vuse (stmt)) + || gimple_vuse (stmt) + /* const calls don't match any of the above, yet they could + still have some side-effects - they could contain + gimple_could_trap_p statements, like floating point + exceptions or integer division by zero. See PR70586. + FIXME: perhaps gimple_has_side_effects or gimple_could_trap_p + should handle this. */ + || is_gimple_call (stmt)) return false; } |