From 31271e9129c949aeb4628021a34191d696d75e34 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 12 Nov 2015 14:02:44 +0000 Subject: [PATCH] re PR tree-optimization/68306 (ICE: in vectorizable_store, at tree-vect-stmts.c:5651) 2015-11-12 Richard Biener 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. From-SVN: r230260 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr68306.c | 10 ++++++++++ gcc/tree-vect-data-refs.c | 22 ++++++++++++---------- 4 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr68306.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7089985c980..ecd37115d82 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-11-12 Richard Biener + + 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. + 2015-11-12 Nathan Sidwell gcc/ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ace9cfd5234..7d32ad87903 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-12 Richard Biener + + PR tree-optimization/68306 + * gcc.dg/pr68306.c: New testcase. + 2015-11-12 Ville Voutilainen Implement D0013R2, logical type traits. diff --git a/gcc/testsuite/gcc.dg/pr68306.c b/gcc/testsuite/gcc.dg/pr68306.c new file mode 100644 index 00000000000..b36fb347117 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr68306.c @@ -0,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; } diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index f7471b8a75e..da5b2e98a1c 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -909,14 +909,9 @@ verify_data_ref_alignment (data_reference_p dr) 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)) + /* 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 @@ -965,8 +960,15 @@ vect_verify_datarefs_alignment (loop_vec_info vinfo) unsigned int i; FOR_EACH_VEC_ELT (datarefs, i, dr) - if (! verify_data_ref_alignment (dr)) - return false; + { + 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; } -- 2.30.2