This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR44214
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?
Thanks,
Bill