Commit 9b8e85a5 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/83523 (ICE: verify_gimple failed (error: statement…

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
parent a4710e09
2017-12-21 Jakub Jelinek <jakub@redhat.com> 2017-12-21 Jakub Jelinek <jakub@redhat.com>
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.
PR tree-optimization/83521 PR tree-optimization/83521
* tree-ssa-phiopt.c (factor_out_conditional_conversion): Use * tree-ssa-phiopt.c (factor_out_conditional_conversion): Use
gimple_build_assign without code on result of gimple_build_assign without code on result of
2017-12-21 Jakub Jelinek <jakub@redhat.com> 2017-12-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/83523
* g++.dg/tree-ssa/pr83523.C: New test.
PR tree-optimization/83521 PR tree-optimization/83521
* gcc.dg/pr83521.c: New test. * gcc.dg/pr83521.c: New test.
......
// PR tree-optimization/83523
// { dg-do compile }
// { dg-options "-O2 -fexceptions -fnon-call-exceptions -ftrapv" }
#ifdef __SIZEOF_INT128__
typedef __int128 T;
typedef long long int U;
#else
typedef long long int T;
typedef int U;
#endif
struct S { S (); ~S (); };
void bar ();
T
foo (U x, U y)
{
T z = x;
S s;
bar ();
z *= y;
bar ();
return z;
}
...@@ -2196,8 +2196,12 @@ is_widening_mult_p (gimple *stmt, ...@@ -2196,8 +2196,12 @@ is_widening_mult_p (gimple *stmt,
{ {
tree type = TREE_TYPE (gimple_assign_lhs (stmt)); tree type = TREE_TYPE (gimple_assign_lhs (stmt));
if (TREE_CODE (type) != INTEGER_TYPE if (TREE_CODE (type) == INTEGER_TYPE)
&& TREE_CODE (type) != FIXED_POINT_TYPE) {
if (TYPE_OVERFLOW_TRAPS (type))
return false;
}
else if (TREE_CODE (type) != FIXED_POINT_TYPE)
return false; return false;
if (!is_widening_mult_rhs_p (type, gimple_assign_rhs1 (stmt), type1_out, 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) ...@@ -2656,7 +2660,7 @@ convert_mult_to_fma (gimple *mul_stmt, tree op1, tree op2)
/* We don't want to do bitfield reduction ops. */ /* We don't want to do bitfield reduction ops. */
if (INTEGRAL_TYPE_P (type) if (INTEGRAL_TYPE_P (type)
&& !type_has_mode_precision_p (type)) && (!type_has_mode_precision_p (type) || TYPE_OVERFLOW_TRAPS (type)))
return false; return false;
/* If the target doesn't support it, don't generate it. We assume that /* If the target doesn't support it, don't generate it. We assume that
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment