https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77550
--- Comment #12 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- (In reply to Markus Trippelsdorf from comment #11) > (In reply to Bernd Edlinger from comment #9) > > I'm unable to reduce the test case... > > Creduce is running and hopefully I will have a small testcase tomorrow > morning. > > good luck. here is a hacky patch, test case passes, but I don't know if it is going design-wise in the right direction: --- tree-vect-stmts.c 2016-09-11 19:53:01.841182370 +0200 +++ tree-vect-stmts.c 2016-09-11 19:34:15.691171637 +0200 @@ -5482,6 +5483,7 @@ gimple *new_stmt; int vf; vec_load_store_type vls_type; + bool alias_p = false; if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo) return false; @@ -5740,6 +5742,16 @@ first_stmt = GROUP_FIRST_ELEMENT (stmt_info); first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt)); group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt)); + next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (first_stmt)); + for (i = 1; i < group_size; i++) + { + struct data_reference *next_dr + = STMT_VINFO_DATA_REF (vinfo_for_stmt (next_stmt)); + if (get_alias_set (DR_REF (first_dr)) + != get_alias_set (DR_REF (next_dr))) + alias_p = true; + next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt)); + } GROUP_STORE_COUNT (vinfo_for_stmt (first_stmt))++; @@ -6174,8 +6188,10 @@ dataref_ptr, dataref_offset ? dataref_offset - : build_int_cst (reference_alias_ptr_type - (DR_REF (first_dr)), 0)); + : build_int_cst (alias_p + ? ptr_type_node + : reference_alias_ptr_type + (DR_REF (first_dr)), 0)); align = TYPE_ALIGN_UNIT (vectype); if (aligned_access_p (first_dr)) misalign = 0;