Commit 50cd60be by Janis Johnson Committed by Janis Johnson

re PR c/39902 (x * 1.0DF gets wrong value)

	PR c/39902
	* simplify-rtx.c (simplify_binary_operation_1): Disable
	simplifications for decimal float operations.

	PR c/39902
	* gcc.target/powerpc/pr39902-2.c: New test.

From-SVN: r150383
parent 1768a052
2009-08-03 Janis Johnson <janis187@us.ibm.com>
PR c/39902
* simplify-rtx.c (simplify_binary_operation_1): Disable
simplifications for decimal float operations.
2009-08-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/40943
......
......@@ -1997,6 +1997,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
/* x*2 is x+x and x*(-1) is -x */
if (GET_CODE (trueop1) == CONST_DOUBLE
&& SCALAR_FLOAT_MODE_P (GET_MODE (trueop1))
&& !DECIMAL_FLOAT_MODE_P (GET_MODE (trueop1))
&& GET_MODE (op0) == mode)
{
REAL_VALUE_TYPE d;
......
2009-08-03 Janis Johnson <janis187@us.ibm.com>
PR c/39902
* gcc.target/powerpc/pr39902-2.c: New test.
2009-08-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/40943
......
/* Check that simplification "x*(-1)" -> "-x" is not performed for decimal
float types. */
/* { dg-do compile { target { powerpc*-*-linux* && powerpc_fprs } } } */
/* { dg-options "-std=gnu99 -O -mcpu=power6" } */
/* { dg-final { scan-assembler-not "fneg" } } */
extern _Decimal32 a32, b32;
extern _Decimal64 a64, b64;
extern _Decimal128 a128, b128;
void
foo32 (void)
{
b32 = a32 * -1.0DF;
}
void
foo64 (void)
{
b64 = a64 * -1.0DD;
}
void
foo128 (void)
{
b128 = a128 * -1.0DL;
}
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