public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106322] [12/13 Regression] tree-vectorize: Wrong code at O2 level (-fno-tree-vectorize is working) since r12-2404-ga1d27560770818c5 Date: Wed, 10 Aug 2022 06:03:50 +0000 [thread overview] Message-ID: <bug-106322-4-F8ja9ExgGf@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-106322-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106322 --- Comment #39 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Comment on attachment 53428 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53428 untested patch >diff --git a/gcc/internal-fn.cc b/gcc/internal-fn.cc >index d666ccccf67..7d8b4ac2200 100644 >--- a/gcc/internal-fn.cc >+++ b/gcc/internal-fn.cc >@@ -3750,7 +3750,12 @@ static bool > direct_optab_supported_p (direct_optab optab, tree_pair types, > optimization_type opt_type) > { >- machine_mode mode = TYPE_MODE (types.first); >+ tree type = types.first; >+ machine_mode mode = TYPE_MODE (type); >+ /* Scalar mode optab can't work for vector type, return false if >+ the given type is vector type but the mode isn't vector mode. */ >+ if (VECTOR_TYPE_P (type) != VECTOR_MODE_P (mode)) >+ return false; There are a few which scalar mode and vector types can differ and still work: IOR, XOR, and AND. I wonder if those should be special cased here or somewhere else. > gcc_checking_assert (mode == TYPE_MODE (types.second)); > return direct_optab_handler (optab, mode, opt_type) != CODE_FOR_nothing; > } >@@ -3763,6 +3768,12 @@ static bool > convert_optab_supported_p (convert_optab optab, tree_pair types, > optimization_type opt_type) > { >+ tree type = types.first; >+ machine_mode mode = TYPE_MODE (type); >+ /* Scalar mode optab can't work for vector type, return false if >+ the given type is vector type but the mode isn't vector mode. */ >+ if (VECTOR_TYPE_P (type) != VECTOR_MODE_P (mode)) >+ return false; > return (convert_optab_handler (optab, TYPE_MODE (types.first), > TYPE_MODE (types.second), opt_type) > != CODE_FOR_nothing); >@@ -3778,6 +3789,7 @@ multi_vector_optab_supported_p (convert_optab optab, tree_pair types, > gcc_assert (TREE_CODE (types.first) == ARRAY_TYPE); > machine_mode imode = TYPE_MODE (types.first); > machine_mode vmode = TYPE_MODE (TREE_TYPE (types.first)); >+ gcc_assert (VECTOR_MODE_P (vmode)); > return (convert_optab_handler (optab, imode, vmode, opt_type) > != CODE_FOR_nothing); > }
next prev parent reply other threads:[~2022-08-10 6:03 UTC|newest] Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-16 9:48 [Bug c++/106322] New: i386: Wrong code at O2 level (O0 / O1 are working) malat at debian dot org 2022-07-16 9:55 ` [Bug c++/106322] " malat at debian dot org 2022-07-16 10:00 ` malat at debian dot org 2022-07-16 10:00 ` malat at debian dot org 2022-07-16 10:02 ` malat at debian dot org 2022-07-16 10:02 ` malat at debian dot org 2022-07-16 10:07 ` malat at debian dot org 2022-07-16 10:15 ` malat at debian dot org 2022-07-17 20:20 ` [Bug target/106322] " pinskia at gcc dot gnu.org 2022-07-18 8:48 ` marxin at gcc dot gnu.org 2022-07-18 14:40 ` malat at debian dot org 2022-07-19 7:58 ` ubizjak at gmail dot com 2022-08-03 8:41 ` malat at debian dot org 2022-08-03 12:31 ` [Bug tree-optimization/106322] 32bits / tree-vectorize: Wrong code at O2 level (-fno-tree-vectorize is working) malat at debian dot org 2022-08-03 12:32 ` malat at debian dot org 2022-08-03 12:33 ` malat at debian dot org 2022-08-05 13:14 ` [Bug tree-optimization/106322] " malat at debian dot org 2022-08-08 7:12 ` malat at debian dot org 2022-08-08 7:20 ` malat at debian dot org 2022-08-08 10:00 ` malat at debian dot org 2022-08-09 7:50 ` malat at debian dot org 2022-08-09 12:36 ` marxin at gcc dot gnu.org 2022-08-09 12:58 ` malat at debian dot org 2022-08-09 13:00 ` ubizjak at gmail dot com 2022-08-09 13:03 ` malat at debian dot org 2022-08-09 13:04 ` marxin at gcc dot gnu.org 2022-08-09 13:05 ` malat at debian dot org 2022-08-09 13:11 ` [Bug tree-optimization/106322] [12/13 Regression] tree-vectorize: Wrong code at O2 level (-fno-tree-vectorize is working) since r12-2404-ga1d27560770818c5 marxin at gcc dot gnu.org 2022-08-09 13:12 ` marxin at gcc dot gnu.org 2022-08-09 13:26 ` linkw at gcc dot gnu.org 2022-08-09 13:29 ` marxin at gcc dot gnu.org 2022-08-09 13:30 ` malat at debian dot org 2022-08-09 13:34 ` malat at debian dot org 2022-08-09 13:40 ` linkw at gcc dot gnu.org 2022-08-09 13:48 ` rguenth at gcc dot gnu.org 2022-08-09 13:53 ` malat at debian dot org 2022-08-09 13:56 ` malat at debian dot org 2022-08-09 14:01 ` malat at debian dot org 2022-08-09 15:28 ` pinskia at gcc dot gnu.org 2022-08-10 5:25 ` linkw at gcc dot gnu.org 2022-08-10 5:34 ` linkw at gcc dot gnu.org 2022-08-10 6:03 ` pinskia at gcc dot gnu.org [this message] 2022-08-10 6:24 ` linkw at gcc dot gnu.org 2022-08-10 9:47 ` linkw at gcc dot gnu.org 2022-08-10 12:32 ` rguenth at gcc dot gnu.org 2022-08-10 12:36 ` rguenth at gcc dot gnu.org 2022-08-11 1:18 ` linkw at gcc dot gnu.org 2022-08-15 6:51 ` linkw at gcc dot gnu.org 2022-08-16 5:50 ` cvs-commit at gcc dot gnu.org 2022-08-24 2:31 ` [Bug tree-optimization/106322] [12 " cvs-commit at gcc dot gnu.org 2022-08-24 2:53 ` linkw at gcc dot gnu.org 2022-08-24 6:51 ` rguenth at gcc dot gnu.org 2022-09-27 14:14 ` malat at debian dot org 2022-09-27 14:18 ` malat at debian dot org 2022-09-28 6:11 ` malat at debian dot org 2022-09-28 6:26 ` linkw at gcc dot gnu.org
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=bug-106322-4-F8ja9ExgGf@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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: linkBe 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).