The following fixes PR68306, an ordering issue with my last BB
vectorization patch.  Fixed by removing that ordering requirement.

Bootstrapped and tested on x86_64-unknown-linux-gnu.

Richard.

2015-11-12  Richard Biener  <rguent...@suse.de>

        PR tree-optimization/68306
        * tree-vect-data-refs.c (verify_data_ref_alignment): Remove
        relevant and vectorizable checks here.
        (vect_verify_datarefs_alignment): Add relevant check here.

        * gcc.dg/pr68306.c: New testcase.

Index: gcc/tree-vect-data-refs.c
===================================================================
*** gcc/tree-vect-data-refs.c   (revision 230216)
--- gcc/tree-vect-data-refs.c   (working copy)
*************** verify_data_ref_alignment (data_referenc
*** 909,922 ****
    gimple *stmt = DR_STMT (dr);
    stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
  
!   if (!STMT_VINFO_RELEVANT_P (stmt_info))
!     return true;
! 
!   /* For interleaving, only the alignment of the first access matters. 
!      Skip statements marked as not vectorizable.  */
!   if ((STMT_VINFO_GROUPED_ACCESS (stmt_info)
!        && GROUP_FIRST_ELEMENT (stmt_info) != stmt)
!       || !STMT_VINFO_VECTORIZABLE (stmt_info))
      return true;
  
    /* Strided accesses perform only component accesses, alignment is
--- 889,897 ----
    gimple *stmt = DR_STMT (dr);
    stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
  
!   /* For interleaving, only the alignment of the first access matters.   */
!   if (STMT_VINFO_GROUPED_ACCESS (stmt_info)
!       && GROUP_FIRST_ELEMENT (stmt_info) != stmt)
      return true;
  
    /* Strided accesses perform only component accesses, alignment is
*************** vect_verify_datarefs_alignment (loop_vec
*** 965,972 ****
    unsigned int i;
  
    FOR_EACH_VEC_ELT (datarefs, i, dr)
!     if (! verify_data_ref_alignment (dr))
!       return false;
  
    return true;
  }
--- 940,954 ----
    unsigned int i;
  
    FOR_EACH_VEC_ELT (datarefs, i, dr)
!     {
!       gimple *stmt = DR_STMT (dr);
!       stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
! 
!       if (!STMT_VINFO_RELEVANT_P (stmt_info))
!       continue;
!       if (! verify_data_ref_alignment (dr))
!       return false;
!     }
  
    return true;
  }
Index: gcc/testsuite/gcc.dg/pr68306.c
===================================================================
*** gcc/testsuite/gcc.dg/pr68306.c      (revision 0)
--- gcc/testsuite/gcc.dg/pr68306.c      (working copy)
***************
*** 0 ****
--- 1,10 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O3" } */
+ 
+ enum powerpc_pmc_type { PPC_PMC_IBM };
+ struct {
+     unsigned num_pmcs;
+     enum powerpc_pmc_type pmc_type;
+ } a;
+ enum powerpc_pmc_type b;
+ void fn1() { a.num_pmcs = a.pmc_type = b; }

Reply via email to