From 9b8e85a5e3be803e0b476a8bbcb8aee0e9c48837 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 21 Dec 2017 20:27:21 +0100 Subject: 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 --- gcc/tree-ssa-math-opts.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/tree-ssa-math-opts.c') 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 -- cgit v1.1