aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.cc
diff options
context:
space:
mode:
authorTejas Belagod <tejas.belagod@arm.com>2024-03-06 15:30:26 +0530
committerTejas Belagod <tejas.belagod@arm.com>2024-03-15 11:40:24 +0530
commit81f3d963e05de8b17d4ccc7667ead9ed156193a4 (patch)
tree4978f09fcdee07fbbfe41e5327f516040ddb5811 /gcc/tree-vect-patterns.cc
parentd7d05824ae68da24908d97a10b9ec59d08f75a90 (diff)
downloadgcc-81f3d963e05de8b17d4ccc7667ead9ed156193a4.zip
gcc-81f3d963e05de8b17d4ccc7667ead9ed156193a4.tar.gz
gcc-81f3d963e05de8b17d4ccc7667ead9ed156193a4.tar.bz2
vect: Call vect_convert_output with the right vecitype [PR114108]
This patch fixes a bug where vect_recog_abd_pattern called vect_convert_output with the incorrect vecitype for the corresponding pattern_stmt. vect_convert_output expects vecitype to be the vector form of the scalar type of the LHS of pattern_stmt, but we were passing in the vector form of the LHS of the new impending conversion statement. This caused a skew in ABD's pattern_stmt having the vectype of the following gimple pattern_stmt. 2024-03-06 Tejas Belagod <tejas.belagod@arm.com> gcc/ChangeLog: PR middle-end/114108 * tree-vect-patterns.cc (vect_recog_abd_pattern): Call vect_convert_output with the correct vecitype. gcc/testsuite/ChangeLog: * gcc.dg/vect/pr114108.c: New test.
Diffstat (limited to 'gcc/tree-vect-patterns.cc')
-rw-r--r--gcc/tree-vect-patterns.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc
index d562f57..4f491c6 100644
--- a/gcc/tree-vect-patterns.cc
+++ b/gcc/tree-vect-patterns.cc
@@ -1576,9 +1576,8 @@ vect_recog_abd_pattern (vec_info *vinfo,
&& !TYPE_UNSIGNED (abd_out_type))
{
tree unsign = unsigned_type_for (abd_out_type);
- tree unsign_vectype = get_vectype_for_scalar_type (vinfo, unsign);
- stmt = vect_convert_output (vinfo, stmt_vinfo, unsign, stmt,
- unsign_vectype);
+ stmt = vect_convert_output (vinfo, stmt_vinfo, unsign, stmt, vectype_out);
+ vectype_out = get_vectype_for_scalar_type (vinfo, unsign);
}
return vect_convert_output (vinfo, stmt_vinfo, out_type, stmt, vectype_out);