public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2182] middle-end/110461 - pattern applying wrongly to vectors
@ 2023-06-29 8:14 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-06-29 8:14 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:1e6f1659bd7337e91a88086f8092ada01e80ac94
commit r14-2182-g1e6f1659bd7337e91a88086f8092ada01e80ac94
Author: Richard Biener <rguenther@suse.de>
Date: Thu Jun 29 09:15:27 2023 +0200
middle-end/110461 - pattern applying wrongly to vectors
The following guards a match.pd pattern that wasn't supposed to
apply to vectors and thus runs into TYPE_PRECISION checking. For
vector support the constant case is lacking and the pattern would
have missing optab support checking for the result operation.
PR middle-end/110461
* match.pd (bitop (convert@2 @0) (convert?@3 @1)): Disable
for VECTOR_TYPE_P.
* gcc.dg/pr110461.c: New testcase.
Diff:
---
gcc/match.pd | 1 +
gcc/testsuite/gcc.dg/pr110461.c | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/gcc/match.pd b/gcc/match.pd
index 83bcefa914b..f09583bbcac 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -1853,6 +1853,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
|| tree_nop_conversion_p (TREE_TYPE (@0), type)))
|| types_match (@0, @1))
&& !POINTER_TYPE_P (TREE_TYPE (@0))
+ && !VECTOR_TYPE_P (TREE_TYPE (@0))
&& TREE_CODE (TREE_TYPE (@0)) != OFFSET_TYPE
/* ??? This transform conflicts with fold-const.cc doing
Convert (T)(x & c) into (T)x & (T)c, if c is an integer
diff --git a/gcc/testsuite/gcc.dg/pr110461.c b/gcc/testsuite/gcc.dg/pr110461.c
new file mode 100644
index 00000000000..cd23a2b1615
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110461.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+typedef int v4si __attribute__ ((vector_size (4*sizeof(int))));
+typedef short v4hi __attribute__ ((vector_size (4*sizeof(short))));
+
+v4hi res;
+v4hi a, b;
+
+void f(void)
+{
+ v4si t = __builtin_convertvector (a, v4si);
+ v4si t1 = __builtin_convertvector (b, v4si);
+ t ^= t1;
+ res = __builtin_convertvector (t, v4hi);
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-29 8:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29 8:14 [gcc r14-2182] middle-end/110461 - pattern applying wrongly to vectors Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).