+2018-05-29 Richard Biener <rguenther@suse.de>
+
+ * tree-vect-data-refs.c (vect_preserves_scalar_order_p): Make
+ sure to use non-pattern stmts for get_earlier_stmt arguments.
+ * tree-vectorizer.h (get_earlier_stmt): Assert we do not get
+ called on pattern stmts.
+ (get_later_stmt): Likewise.
+
2018-05-29 Martin Liska <mliska@suse.cz>
PR gcov-profile/85759
(but could happen later) while reads will happen no later than their
current position (but could happen earlier). Reordering is therefore
only possible if the first access is a write. */
+ if (is_pattern_stmt_p (stmtinfo_a))
+ stmt_a = STMT_VINFO_RELATED_STMT (stmtinfo_a);
+ if (is_pattern_stmt_p (stmtinfo_b))
+ stmt_b = STMT_VINFO_RELATED_STMT (stmtinfo_b);
gimple *earlier_stmt = get_earlier_stmt (stmt_a, stmt_b);
return !DR_IS_WRITE (STMT_VINFO_DATA_REF (vinfo_for_stmt (earlier_stmt)));
}
if (uid1 == 0 || uid2 == 0)
return NULL;
- gcc_checking_assert (uid1 <= stmt_vec_info_vec->length ()
- && uid2 <= stmt_vec_info_vec->length ());
+ gcc_assert (uid1 <= stmt_vec_info_vec->length ()
+ && uid2 <= stmt_vec_info_vec->length ());
+ gcc_checking_assert ((STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (stmt1))
+ || !STMT_VINFO_RELATED_STMT (vinfo_for_stmt (stmt1)))
+ && (STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (stmt2))
+ || !STMT_VINFO_RELATED_STMT (vinfo_for_stmt (stmt2))));
if (uid1 < uid2)
return stmt1;
if (uid1 == 0 || uid2 == 0)
return NULL;
- gcc_assert (uid1 <= stmt_vec_info_vec->length ());
- gcc_assert (uid2 <= stmt_vec_info_vec->length ());
+ gcc_assert (uid1 <= stmt_vec_info_vec->length ()
+ && uid2 <= stmt_vec_info_vec->length ());
+ gcc_checking_assert ((STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (stmt1))
+ || !STMT_VINFO_RELATED_STMT (vinfo_for_stmt (stmt1)))
+ && (STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (stmt2))
+ || !STMT_VINFO_RELATED_STMT (vinfo_for_stmt (stmt2))));
if (uid1 > uid2)
return stmt1;