This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] further fix for c/39902 for decimal float constant


On Thu, Jul 30, 2009 at 7:13 PM, Janis Johnson<janis187@us.ibm.com> wrote:
> A simplification performed in simplify_binary_operation_1 is not valid
> for decimal float operations, where trailing zeroes are significant.
> On trunk and the 4.4 branch this only shows up when compiling with
> optimization and -mhard-dfp, but on the 4.3 branch it also causes
> failures with soft-dfp without optimization due to the way libcalls
> are processed there.
>
> This replaces an unapproved patch I posted for 4.3 a couple of weeks
> ago.
>
> Bootstrapped and regression tested on powerpc64-linux with -m32/-m64;
> ok for trunk, 4.4, and 4.3?

Ok.  Ok specifically also for 4.3 that is still frozen.

Thanks,
Richard.

> 2009-07-30 ?Janis Johnson ?<janis187@us.ibm.com>
>
> gcc/
> ? ? ? ?PR c/39902
> ? ? ? ?* simplify-rtx.c (simplify_binary_operation_1): Disable
> ? ? ? ?simplifications for decimal float operations.
>
> gcc/testsuite/
> ? ? ? ?PR c/39902
> ? ? ? ?* gcc.target/powerpc/pr39902-2.c: New test.
>
> Index: gcc/simplify-rtx.c
> ===================================================================
> --- gcc/simplify-rtx.c ?(revision 150228)
> +++ gcc/simplify-rtx.c ?(working copy)
> @@ -1997,6 +1997,7 @@ simplify_binary_operation_1 (enum rtx_co
> ? ? ? /* 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;
> Index: gcc/testsuite/gcc.target/powerpc/pr39902-2.c
> ===================================================================
> --- gcc/testsuite/gcc.target/powerpc/pr39902-2.c ? ? ? ?(revision 0)
> +++ gcc/testsuite/gcc.target/powerpc/pr39902-2.c ? ? ? ?(revision 0)
> @@ -0,0 +1,28 @@
> +/* 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;
> +}
>
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]