]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/112990 - unsupported VEC_PERM from match pattern
authorRichard Biener <rguenther@suse.de>
Wed, 13 Dec 2023 08:38:59 +0000 (09:38 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 13 Dec 2023 08:42:17 +0000 (09:42 +0100)
The following avoids creating an unsupported VEC_PERM after vector
lowering from the pattern merging a bit-insert from a bit-field-ref
to a VEC_PERM.  For the already existing s390 testcase we get
TImode vectors which later ICE during attempted expansion of
a vec_perm_const.

PR tree-optimization/112990
* match.pd (bit_insert @0 (BIT_FIELD_REF @1 ..) ..):
Restrict to vector modes after lowering.

gcc/match.pd

index 15bca217aafba4873cbcb4daa81eb1c80a7a7cf3..e3dcff5c29ca08655aaa2ab0e82c01e2dfba6834 100644 (file)
@@ -8505,6 +8505,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 (simplify
  (bit_insert @0 (BIT_FIELD_REF@2 @1 @rsize @rpos) @ipos)
  (if (VECTOR_TYPE_P (type)
+      && (VECTOR_MODE_P (TYPE_MODE (type))
+         || optimize_vectors_before_lowering_p ())
       && types_match (@0, @1)
       && types_match (TREE_TYPE (TREE_TYPE (@0)), TREE_TYPE (@2))
       && TYPE_VECTOR_SUBPARTS (type).is_constant ())