aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-12-05 21:56:14 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-12-05 21:56:14 +0100
commit0fb808ea7a0f30531e9a1495b9aafa5267c2f0b5 (patch)
treeee9328a0873b74fdcbd5ebe510e67699561cd4bf /gcc/tree-ssa-math-opts.c
parent17fe0fdbad5fd777bbfa62b44cd97becb5f72056 (diff)
downloadgcc-0fb808ea7a0f30531e9a1495b9aafa5267c2f0b5.zip
gcc-0fb808ea7a0f30531e9a1495b9aafa5267c2f0b5.tar.gz
gcc-0fb808ea7a0f30531e9a1495b9aafa5267c2f0b5.tar.bz2
re PR tree-optimization/51396 (ICE: verify_flow_info failed: BB 4 can not throw but has an EH edge with -O2 -fnon-call-exceptions -mfma4)
PR tree-optimization/51396 * tree-ssa-math-opts.c (convert_mult_to_fma): Don't optimize if MUL_RESULT has zero uses. * g++.dg/opt/pr51396.C: New test. From-SVN: r182028
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 75abb336..06a4505 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -2429,6 +2429,12 @@ convert_mult_to_fma (gimple mul_stmt, tree op1, tree op2)
if (optab_handler (fma_optab, TYPE_MODE (type)) == CODE_FOR_nothing)
return false;
+ /* If the multiplication has zero uses, it is kept around probably because
+ of -fnon-call-exceptions. Don't optimize it away in that case,
+ it is DCE job. */
+ if (has_zero_uses (mul_result))
+ return false;
+
/* Make sure that the multiplication statement becomes dead after
the transformation, thus that all uses are transformed to FMAs.
This means we assume that an FMA operation has the same cost