diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-12-21 20:27:21 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-12-21 20:27:21 +0100 |
commit | 9b8e85a5e3be803e0b476a8bbcb8aee0e9c48837 (patch) | |
tree | 596ed8170302cc0de6ee4ac60a9c475bef9add5e /gcc/tree-ssa-math-opts.c | |
parent | a4710e09ed089313e3d4189d00fcfc487262e05a (diff) | |
download | gcc-9b8e85a5e3be803e0b476a8bbcb8aee0e9c48837.zip gcc-9b8e85a5e3be803e0b476a8bbcb8aee0e9c48837.tar.gz gcc-9b8e85a5e3be803e0b476a8bbcb8aee0e9c48837.tar.bz2 |
re PR tree-optimization/83523 (ICE: verify_gimple failed (error: statement marked for throw, but doesn't))
PR tree-optimization/83523
* tree-ssa-math-opts.c (is_widening_mult_p): Return false if
for INTEGER_TYPE TYPE_OVERFLOW_TRAPS.
(convert_mult_to_fma): Likewise.
* g++.dg/tree-ssa/pr83523.C: New test.
From-SVN: r255953
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r-- | gcc/tree-ssa-math-opts.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index 4e8f5e7..553a37c 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -2196,8 +2196,12 @@ is_widening_mult_p (gimple *stmt, { tree type = TREE_TYPE (gimple_assign_lhs (stmt)); - if (TREE_CODE (type) != INTEGER_TYPE - && TREE_CODE (type) != FIXED_POINT_TYPE) + if (TREE_CODE (type) == INTEGER_TYPE) + { + if (TYPE_OVERFLOW_TRAPS (type)) + return false; + } + else if (TREE_CODE (type) != FIXED_POINT_TYPE) return false; if (!is_widening_mult_rhs_p (type, gimple_assign_rhs1 (stmt), type1_out, @@ -2656,7 +2660,7 @@ convert_mult_to_fma (gimple *mul_stmt, tree op1, tree op2) /* We don't want to do bitfield reduction ops. */ if (INTEGRAL_TYPE_P (type) - && !type_has_mode_precision_p (type)) + && (!type_has_mode_precision_p (type) || TYPE_OVERFLOW_TRAPS (type))) return false; /* If the target doesn't support it, don't generate it. We assume that |