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] [RFC] Fix PR 37385 - ICE in set_mem_alias_set with the vectorizer



gcc-patches-owner@gcc.gnu.org wrote on 10/09/2008 10:18:10:

>
>
> "Richard Guenther" <richard.guenther@gmail.com> wrote on 09/09/2008
> 12:14:53:
>
> > On Tue, Sep 9, 2008 at 10:20 AM, Ira Rosen <IRAR@il.ibm.com> wrote:
> > >
> > > The fix of PR 36493
> > > (http://gcc.gnu.org/ml/gcc-patches/2008-06/msg01023.html) verifies
that
> the
> > > accesses through the vector pointer and the original scalar memory
> > > reference alias. In addition before that patch, the type of vector
> store
> > > statement was determined by the RHS of the scalar statement, and now
it
> is
> > > determined by the type of LHS, which seems to cause the ICE in
> > > set_mem_alias_set, at emit-rtl.c:1789.
> > >
> > > The attached patch reverts the second part of the PR 36493 patch.
This
> > > fixes the problem (without hurting PR 36493). I am not sure that the
> fix is
> > > correct, since the types of RHS and LHS are compatible anyway.
> > > I am bootstrapping and testing the patch on x86_64-linux now.
> >
> > I think it's reasonable.  This may be papering over a real problem
> somewhere
> > else as we are not actually verifying if the types in our statements
> > are correct.
>
> Committed revision 140195.
>
> Ira
>
>

I realized, that now, after changing the vectype to be the type of the rhs,
the vectype being checked in vectorizable_store for alias purposes is not
the correct type (but the type of the lhs). This patch fixes that.

Bootstrapped and now testing on x86_64-linux. O.K. to apply once the
testing completes?

Thanks,
Ira

Index: tree-vect-transform.c
===================================================================
--- tree-vect-transform.c       (revision 140195)
+++ tree-vect-transform.c       (working copy)
@@ -5180,6 +5180,9 @@ vectorizable_store (gimple stmt, gimple_
       return false;
     }

+  /* The type of the vector store is determined by the rhs.  */
+  vectype = get_vectype_for_scalar_type (TREE_TYPE (op));
+
   /* If accesses through a pointer to vectype do not alias the original
      memory reference we have a problem.  */
   if (get_alias_set (vectype) != get_alias_set (TREE_TYPE (scalar_dest))


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