public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-7195] middle-end/104496 - fix vectorized_internal_fn_supported_p
Date: Fri, 11 Feb 2022 10:28:38 +0000 (GMT)	[thread overview]
Message-ID: <20220211102838.08A35385800C@sourceware.org> (raw)

https://gcc.gnu.org/g:72f8d228aff80ede554b1735533af7eb0bd4a912

commit r12-7195-g72f8d228aff80ede554b1735533af7eb0bd4a912
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Feb 11 10:27:20 2022 +0100

    middle-end/104496 - fix vectorized_internal_fn_supported_p
    
    This fixes vectorized_internal_fn_supported_p behavior when
    facing vector types with an integer mode.
    
    2022-02-11  Richard Biener  <rguenther@suse.de>
    
            PR middle-end/104496
            * internal-fn.cc (vectorized_internal_fn_supported_p):
            Bail out for integer mode vector types.
    
            * gcc.target/i386/pr104496.c: New testcase.

Diff:
---
 gcc/internal-fn.cc                       |  3 ++-
 gcc/testsuite/gcc.target/i386/pr104496.c | 12 ++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/gcc/internal-fn.cc b/gcc/internal-fn.cc
index 71ac483f88a..3f1fbc6c91a 100644
--- a/gcc/internal-fn.cc
+++ b/gcc/internal-fn.cc
@@ -4392,7 +4392,8 @@ vectorized_internal_fn_supported_p (internal_fn ifn, tree type)
     return direct_internal_fn_supported_p (ifn, type, OPTIMIZE_FOR_SPEED);
 
   scalar_mode smode;
-  if (!is_a <scalar_mode> (TYPE_MODE (type), &smode))
+  if (VECTOR_TYPE_P (type)
+      || !is_a <scalar_mode> (TYPE_MODE (type), &smode))
     return false;
 
   machine_mode vmode = targetm.vectorize.preferred_simd_mode (smode);
diff --git a/gcc/testsuite/gcc.target/i386/pr104496.c b/gcc/testsuite/gcc.target/i386/pr104496.c
new file mode 100644
index 00000000000..62d3bc60281
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr104496.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mgeneral-regs-only -msse" } */
+
+typedef int __attribute__((__vector_size__ (8))) V;
+V a, b;
+int c;
+
+void
+foo (void)
+{
+  b = 0 != a | b << c;
+}


                 reply	other threads:[~2022-02-11 10:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220211102838.08A35385800C@sourceware.org \
    --to=rguenth@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).