Patchwork Fix PR44214

login
register
mail settings
Submitter William J. Schmidt
Date April 23, 2012, 2:08 p.m.
Message ID <1335190108.4814.1.camel@oc2474580526.ibm.com>
Download mbox | patch
Permalink /patch/154457/
State New
Headers show

Comments

William J. Schmidt - April 23, 2012, 2:08 p.m.
On Mon, 2012-04-23 at 11:09 +0200, Richard Guenther wrote:
> On Fri, 20 Apr 2012, William J. Schmidt wrote:
> 
> > On Fri, 2012-04-20 at 11:32 -0700, H.J. Lu wrote:
> > > On Thu, Apr 19, 2012 at 6:58 PM, William J. Schmidt
> > > <wschmidt@linux.vnet.ibm.com> wrote:
> > > > This enhances constant folding for division by complex and vector
> > > > constants.  When -freciprocal-math is present, such divisions are
> > > > converted into multiplies by the constant reciprocal.  When an exact
> > > > reciprocal is available, this is done for vector constants when
> > > > optimizing.  I did not implement logic for exact reciprocals of complex
> > > > constants because either (a) the complexity doesn't justify the
> > > > likelihood of occurrence, or (b) I'm lazy.  Your choice. ;)
> > > >
> > > > Bootstrapped with no new regressions on powerpc64-unknown-linux-gnu.  Ok
> > > > for trunk?
> > > >
> > > > Thanks,
> > > > Bill
> > > >
> > > >
> > > > gcc:
> > > >
> > > > 2012-04-19  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
> > > >
> > > >        PR rtl-optimization/44214
> > > >        * fold-const.c (exact_inverse): New function.
> > > >        (fold_binary_loc): Fold vector and complex division by constant into
> > > >        multiply by recripocal with flag_reciprocal_math; fold vector division
> > > >        by constant into multiply by reciprocal with exact inverse.
> > > >
> > > > gcc/testsuite:
> > > >
> > > 
> > > It caused:
> > > 
> > > FAIL: gcc.dg/torture/builtin-explog-1.c  -O0  (test for excess errors)
> > > FAIL: gcc.dg/torture/builtin-power-1.c  -O0  (test for excess errors)
> > > 
> > > on x86.
> > > 
> > 
> > Hm, sorry, I don't know how that escaped my testing.  This was due to
> > the suggestion to have the "optimize" test encompass the
> > -freciprocal-math test.  Looks like this changes some expected behavior,
> > at least for these two tests.  
> > 
> > Two options: Revert the move of the "optimize" test, or change the tests
> > to require -O1 or above.  Richard, what's your preference?
> 
> Change the test to require -O1 or above.
> 
> Richard.
> 

OK, following committed as obvious.

Thanks,
Bill


gcc-testsuite:

2012-04-23  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR regression/53076
	* gcc.dg/torture/builtin-explog-1.c: Skip if -O0.
	* gcc.dg/torture/builtin-power-1.c: Likewise.

Patch

Index: gcc/testsuite/gcc.dg/torture/builtin-explog-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/builtin-explog-1.c	(revision 186624)
+++ gcc/testsuite/gcc.dg/torture/builtin-explog-1.c	(working copy)
@@ -7,6 +7,7 @@ 
 
 /* { dg-do link } */
 /* { dg-options "-ffast-math" } */
+/* { dg-skip-if "PR44214" { *-*-* } { "-O0" } { "" } } */
 
 /* Define "e" with as many bits as found in builtins.c:dconste.  */
 #define M_E  2.7182818284590452353602874713526624977572470936999595749669676277241
Index: gcc/testsuite/gcc.dg/torture/builtin-power-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/builtin-power-1.c	(revision 186624)
+++ gcc/testsuite/gcc.dg/torture/builtin-power-1.c	(working copy)
@@ -8,6 +8,7 @@ 
 /* { dg-do link } */
 /* { dg-options "-ffast-math" } */
 /* { dg-add-options c99_runtime } */
+/* { dg-skip-if "PR44214" { *-*-* } { "-O0" } { "" } } */
 
 #include "../builtins-config.h"