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] Fix PR tree-optimization/46663



Richard Guenther <richard.guenther@gmail.com> wrote on 01/12/2010 01:58:38
PM:
>
> On Wed, Dec 1, 2010 at 11:13 AM, Ira Rosen <IRAR@il.ibm.com> wrote:
> >
> > Hi,
> >
> > This patch adds a check that FUNCTION_DECL exists for the call in
> > vectorizer power pattern recognition.
> > I am testing the patch for trunk on x86_64-suse-linux now.
> >
> > The problem goes back to 4.0, how far back should I backport this fix?
>
> Till 4.3, but the fix is not complete, it also needs
>
> > +  if (fn == NULL_TREE
>           || DECL_BUILT_IN_CLASS (fn) !=  BUILT_IN_NORMAL)
> > +   return NULL;
>
> otherwise it'll match target and non-builtins as well.

OK, I'll add this check.

Thanks,
Ira

>
> Richard.
>
> > Thanks,
> > Ira
> >
> > ChangeLog:
> >
> > ? ? ? ?PR tree-optimization/46663
> > ? ? ? ?* tree-vect-patterns.c (vect_recog_pow_pattern): Check that
> > ? ? ? ?FUNCTION_DECL exists.
> >
> > testsuite/ChangeLog:
> >
> > ? ? ? ?PR tree-optimization/46663
> > ? ? ? ?* gcc.dg/vect/pr46663.c: New test.
> >
> >
> > Index: testsuite/gcc.dg/vect/pr46663.c
> > ===================================================================
> > --- testsuite/gcc.dg/vect/pr46663.c ? ? (revision 0)
> > +++ testsuite/gcc.dg/vect/pr46663.c ? ? (revision 0)
> > @@ -0,0 +1,14 @@
> > +/* { dg-do compile } */
> > +/* { dg-options "-O -ftree-vectorize -fdump-tree-vect-details
> > -fexceptions" } */
> > +
> > +typedef __attribute__ ((const)) int (*bart) (void);
> > +
> > +int foo (bart bar, int m)
> > +{
> > + ?int i, j = 0;
> > + ?for (i = 0; i < m; i++)
> > + ? ?j += bar();
> > + ?return j;
> > +}
> > +
> > +/* { dg-final { cleanup-tree-dump "vect" } } */
> > Index: tree-vect-patterns.c
> > ===================================================================
> > --- tree-vect-patterns.c ? ? ? ?(revision 167324)
> > +++ tree-vect-patterns.c ? ? ? ?(working copy)
> > @@ -472,6 +472,9 @@ vect_recog_pow_pattern (gimple last_stmt
> > ? ? return NULL;
> >
> > ? fn = gimple_call_fndecl (last_stmt);
> > + ?if (fn == NULL_TREE)
> > + ? return NULL;
> > +
> > ? switch (DECL_FUNCTION_CODE (fn))
> > ? ? {
> > ? ? case BUILT_IN_POWIF:
> >
> >


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