Commit dfebbdc6 by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/59647 (ICE in simplify_const_unary_operation, at simplify-rtx.c:1597)

	PR rtl-optimization/59647
	* cse.c (cse_process_notes_1): Don't substitute negative VOIDmode
	new_rtx into UNSIGNED_FLOAT rtxes.

	* g++.dg/opt/pr59647.C: New test.

From-SVN: r206267
parent 075691af
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6090,6 +6090,18 @@ cse_process_notes_1 (rtx x, rtx object, bool *changed)
return x;
}
case UNSIGNED_FLOAT:
{
rtx new_rtx = cse_process_notes (XEXP (x, 0), object, changed);
/* We don't substitute negative VOIDmode constants into these rtx,
since they would impede folding. */
if (GET_MODE (new_rtx) != VOIDmode
|| (CONST_INT_P (new_rtx) && INTVAL (new_rtx) >= 0)
|| (CONST_DOUBLE_P (new_rtx) && CONST_DOUBLE_HIGH (new_rtx) >= 0))
validate_change (object, &XEXP (x, 0), new_rtx, 0);
return x;
}
case REG:
i = REG_QTY (REGNO (x));
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
// PR rtl-optimization/59647
// { dg-do compile }
// { dg-options "-O2 -fno-tree-vrp" }
// { dg-additional-options "-msse2 -mfpmath=sse" { target { { i?86-*-* x86_64-*-* } && ia32 } } }
void f1 (int);
void f2 ();
double f3 (int);
struct A
{
int f4 () const
{
if (a == 0)
return 1;
return 0;
}
unsigned f5 ()
{
if (!f4 ())
f2 ();
return a;
}
int a;
};
void
f6 (A *x)
{
unsigned b = x->f5 ();
f1 (b - 1 - f3 (x->f5 () - 1U));
}
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