[PATCH]: Add folding of builtin frexp

Kaveh R. GHAZI ghazi@caip.rutgers.edu
Tue Feb 27 06:30:00 GMT 2007


On Sun, 25 Feb 2007, Andrew Pinski wrote:

> >
> > On 2/22/07, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> > > This patch folds builtin frexp where thet first argument is constant.
> > >
> > > Tested on sparc-sun-solaris2.10, no regressions.
> > >
> > > Okay for mainline?
> >
> > This is ok with the change below
> >
> > >                 Thanks,
> > >                 --Kaveh
> > >
> > >
> > > 2007-02-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
> > >
> > >         * builtins.c (fold_builtin_frexp): New.
> > >         (fold_builtin_2): Use it.
> > >
> > > testsuite:
> > >         * gcc.dg/torture/builtin-frexp-1.c: New test.
>
> I cannot find the final patch version but this testcase fail on powerpc-linux-gnu and powerpc64-linux-gnu.
> :builtin-frexp-1.c:(.text+0x720): undefined reference to `link_error'^M
> :builtin-frexp-1.c:(.text+0x97c): undefined reference to `link_error'^M
> :builtin-frexp-1.c:(.text+0xeb0): undefined reference to `link_error'^M
> :builtin-frexp-1.c:(.text+0xff4): undefined reference to `link_error'^M
> /tmp/ccQ7VUie.o:builtin-frexp-1.c:(.text+0x11e0): more undefined references to `link_error' follow^M
> -- Pinski

In answer to your question, the final version was here:
http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01869.html

BTW, I assume you fail all three tests, so never mind my previous
question.

I see using the darwin cross that this testcase is also failing on the
long double cases where I use div to create a value with lots of
precision.  E.g. frexp(100/3.0, $i).  The problem is that the div is not
being folded, so nothing else gets folded including the frexp.  When I add
-funsafe-math-optimizations they fold.  Do you know why this fails and
only in the long double case?

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu



More information about the Gcc-patches mailing list