Commit 2679730b by Richard Biener Committed by Richard Biener

re PR tree-optimization/92742 (ICE in info_for_reduction, at tree-vect-loop.c:4367)

2019-12-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92742
	* tree-vect-loop.c (vect_fixup_reduc_chain): Do not
	touch the def-type but verify it is consistent with the
	original stmts.

	* gcc.dg/torture/pr92742.c: New testcase.

From-SVN: r278896
parent a213ab38
2019-12-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/92742
* tree-vect-loop.c (vect_fixup_reduc_chain): Do not
touch the def-type but verify it is consistent with the
original stmts.
2019-12-02 Jakub Jelinek <jakub@redhat.com> 2019-12-02 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/92712 PR tree-optimization/92712
2019-12-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/92742
* gcc.dg/torture/pr92742.c: New testcase.
2019-12-02 Jakub Jelinek <jakub@redhat.com> 2019-12-02 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/92712 PR tree-optimization/92712
......
/* { dg-do compile } */
/* { dg-additional-options "-ftree-vectorize" } */
unsigned int qw;
int
rs (int iq, int wg)
{
for (qw = 0; qw < 2; ++qw)
{
}
while (iq < 1)
{
wg *= qw * 2;
++iq;
}
return wg;
}
...@@ -643,6 +643,8 @@ vect_fixup_reduc_chain (stmt_vec_info stmt_info) ...@@ -643,6 +643,8 @@ vect_fixup_reduc_chain (stmt_vec_info stmt_info)
do do
{ {
stmtp = STMT_VINFO_RELATED_STMT (stmt_info); stmtp = STMT_VINFO_RELATED_STMT (stmt_info);
gcc_checking_assert (STMT_VINFO_DEF_TYPE (stmtp)
== STMT_VINFO_DEF_TYPE (stmt_info));
REDUC_GROUP_FIRST_ELEMENT (stmtp) = firstp; REDUC_GROUP_FIRST_ELEMENT (stmtp) = firstp;
stmt_info = REDUC_GROUP_NEXT_ELEMENT (stmt_info); stmt_info = REDUC_GROUP_NEXT_ELEMENT (stmt_info);
if (stmt_info) if (stmt_info)
...@@ -650,7 +652,6 @@ vect_fixup_reduc_chain (stmt_vec_info stmt_info) ...@@ -650,7 +652,6 @@ vect_fixup_reduc_chain (stmt_vec_info stmt_info)
= STMT_VINFO_RELATED_STMT (stmt_info); = STMT_VINFO_RELATED_STMT (stmt_info);
} }
while (stmt_info); while (stmt_info);
STMT_VINFO_DEF_TYPE (stmtp) = vect_reduction_def;
} }
/* Fixup scalar cycles that now have their stmts detected as patterns. */ /* Fixup scalar cycles that now have their stmts detected as patterns. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment