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: [RFC][patch] Fix PR tree-optimization/39529 - failure in verify_ssa after vectorization


On Tue, Mar 24, 2009 at 12:44 PM, Ira Rosen <IRAR@il.ibm.com> wrote:
>
> Hi,
>
> verify_ssa fails for the attached testcase because of missing definition
> for SMT phi node. I am not sure that this is the right solution, but
> calling mark_sym_for_renaming() after copying the symbol memory tag from
> scalar to vector pointer, fixes the problem.
>
> Bootstrapped with vectorization enabled on powerpc64-suse-linux and
> regtested on x86_64-suse-linux.

It's a workaround that should work.  The issue is that we have for
both stores we replace with one different alias info:

  p_4 = p_1 + 2;
  # a_11 = VDEF <a_7>
  *p_1 = 1;
  D.1598_6 = p_4 + -1;
  # a_13 = VDEF <a_11>
  # SMT.10_14 = VDEF <SMT.10_8>
  *D.1598_6 = 1;

for p_1 we have points-to info while for D.1598_6 we dropped back
to anything (and thus are forced to use a SMT) because of the negative
offset.  The vectorized pointer copies the alias info from the first store
and thus we get an orphaned PHI node for the SMT.

Thus, the patch is ok.

Thanks,
Richard.

> Thanks,
> Ira
>
> ChangeLog:
>
> ? ? ?PR tree-optimization/39529
> ? ? ?* tree-vect-transform.c (vect_create_data_ref_ptr): Call
> ? ? ?mark_sym_for_renaming for the tag copied to the new vector
> ? ? ?pointer.
>
> testsuite/ChangeLog:
>
> ? ? ?PR tree-optimization/39529
> ? ? ?* gcc.dg/vect/pr39529.c: New test.
>
>
> Index: tree-vect-transform.c
> ===================================================================
> --- tree-vect-transform.c ? ? ? (revision 145027)
> +++ tree-vect-transform.c ? ? ? (working copy)
> @@ -1099,7 +1099,10 @@ vect_create_data_ref_ptr (gimple stmt, s
> ? if (!MTAG_P (tag))
> ? ? new_type_alias (vect_ptr, tag, DR_REF (dr));
> ? else
> - ? ?set_symbol_mem_tag (vect_ptr, tag);
> + ? ?{
> + ? ? ?set_symbol_mem_tag (vect_ptr, tag);
> + ? ? ?mark_sym_for_renaming (tag);,
> + ? ?}
>
> ? /** Note: If the dataref is in an inner-loop nested in LOOP, and we are
> ? ? ? vectorizing LOOP (i.e. outer-loop vectorization), we need to create
> two
> Index: testsuite/gcc.dg/vect/pr39529.c
> ===================================================================
> --- testsuite/gcc.dg/vect/pr39529.c ? ? (revision 0)
> +++ testsuite/gcc.dg/vect/pr39529.c ? ? (revision 0)
> @@ -0,0 +1,21 @@
> +/* { dg-do compile } */
> +
> +void
> +foo (void)
> +{
> + ?char a[1024];
> + ?char *p = &a[0];
> + ?char *p2;
> +
> + ?p2 = p + 1024;];
> + ?do
> + ? ?{
> + ? ? ?p += 2;
> + ? ? ?*(p-2) = 1;;
> + ? ? ?*(p-1) = 1;;
> + ? ?} while (p < p2);
> +}
> +}
> +/* { dg-final { cleanup-tree-dump "vect" } } */
> +
> +
>
>


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