aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-11-28 17:26:15 +0100
committerRichard Biener <rguenther@suse.de>2022-11-28 19:41:24 +0100
commit2200b7054638bbf157192a4dca23886dd420becb (patch)
treebb52683097d240a5007b73f3c4fa663892f7f191
parent26aff453bf91921607015a0fd9f09822326beb71 (diff)
downloadgcc-2200b7054638bbf157192a4dca23886dd420becb.zip
gcc-2200b7054638bbf157192a4dca23886dd420becb.tar.gz
gcc-2200b7054638bbf157192a4dca23886dd420becb.tar.bz2
tree-optimization/107896 - allow v2si to dimode unpacks
The following avoids ICEing for V2SI -> DImode vec_unpacks_lo. PR tree-optimization/107896 * tree-vect-stmts.cc (supportable_widening_operation): Handle non-vector mode intermediate mode.
-rw-r--r--gcc/tree-vect-stmts.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index b35b986..5485da5 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -12194,9 +12194,8 @@ supportable_widening_operation (vec_info *vinfo,
if (VECTOR_BOOLEAN_TYPE_P (prev_type))
intermediate_type
= vect_halve_mask_nunits (prev_type, intermediate_mode);
- else
+ else if (VECTOR_MODE_P (intermediate_mode))
{
- gcc_assert (VECTOR_MODE_P (intermediate_mode));
tree intermediate_element_type
= lang_hooks.types.type_for_mode (GET_MODE_INNER (intermediate_mode),
TYPE_UNSIGNED (prev_type));
@@ -12204,6 +12203,10 @@ supportable_widening_operation (vec_info *vinfo,
= build_vector_type_for_mode (intermediate_element_type,
intermediate_mode);
}
+ else
+ intermediate_type
+ = lang_hooks.types.type_for_mode (intermediate_mode,
+ TYPE_UNSIGNED (prev_type));
if (VECTOR_BOOLEAN_TYPE_P (intermediate_type)
&& VECTOR_BOOLEAN_TYPE_P (prev_type)