[PATCH] Fix PR34966, verify_ssa problem with the sincos patch

Richard Guenther richard.guenther@gmail.com
Sat Jan 26 17:52:00 GMT 2008


On Jan 26, 2008 10:02 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Fri, Jan 25, 2008 at 01:07:50PM +0100, Richard Guenther wrote:
> > 2008-01-25  Richard Guenther  <rguenther@suse.de>
> >
> >       PR tree-optimization/34966
> >       * tree-ssa-math-opts.c (execute_cse_sincos_1): For all but
> >       default defs and PHI_NODEs we have to insert after the
> >       defining statement.
> >
> >       * gcc.c-torture/compile/pr34966.c: New testcase.
> >
> > *** testsuite/gcc.c-torture/compile/pr34966.c (revision 0)
> > --- testsuite/gcc.c-torture/compile/pr34966.c (revision 0)
> > ***************
> > *** 0 ****
> > --- 1,17 ----
> > + extern double sin (double), cos (double);
> > +
> > + __inline double
> > + atan (double __x)
> > + {
> > +   register double __result;
> > +   __asm __volatile__ ("" : "=t" (__result) : "0" (__x));
> > +   return __result;
> > + }
> > +
> > + double
> > + f(double x)
> > + {
> > +   double t = atan (x);
> > +   return cos (t) + sin (t);
> > + }
> > +
>
> The test is i?86/x86_64 specific (t constraint is machine specific).
> So, either this test is moved into gcc.target/i386/ (but then it won't
> be cycled through different optimization levels), or e.g.:

doh, right.  I removed the asm but didn't look at the constraints.
Restricting the asm to x86 is ok.

Thanks for cleaning up after me.

Richard.

> 2008-01-26  Jakub Jelinek  <jakub@redhat.com>
>
>         * gcc.c-torture/compile/pr34966.c (atan): Only use asm
>         on i?86/x86_64.
>
> --- gcc/testsuite/gcc.c-torture/compile/pr34966.c.jj    2008-01-26 09:55:35.000000000 +0100
> +++ gcc/testsuite/gcc.c-torture/compile/pr34966.c       2008-01-26 10:00:22.000000000 +0100
> @@ -4,7 +4,11 @@ __inline double
>  atan (double __x)
>  {
>    register double __result;
> +#if defined(__i386__) || defined(__x86_64__)
>    __asm __volatile__ ("" : "=t" (__result) : "0" (__x));
> +#else
> +  __result = __x;
> +#endif
>    return __result;
>  }
>
>
>         Jakub
>



More information about the Gcc-patches mailing list