public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: hongtao Liu <liuhongt@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6567] Fix ICE of unrecognizable insn. [PR target/104001] Date: Fri, 14 Jan 2022 05:02:40 +0000 (GMT) [thread overview] Message-ID: <20220114050240.BE454385841B@sourceware.org> (raw) https://gcc.gnu.org/g:b77e3b4e4589e56c01511fabdbaadb029cd47f5c commit r12-6567-gb77e3b4e4589e56c01511fabdbaadb029cd47f5c Author: liuhongt <hongtao.liu@intel.com> Date: Thu Jan 13 22:51:49 2022 +0800 Fix ICE of unrecognizable insn. [PR target/104001] For define_insn_and_split "*xor2andn": 1. Refine predicate of operands[0] from nonimmediate_operand to register_operand. 2. Remove TARGET_AVX512BW from condition to avoid kmov when TARGET_BMI is not available. gcc/ChangeLog: PR target/104001 PR target/94790 PR target/104014 * config/i386/i386.md (*xor2andn): Refine predicate of operands[0] from nonimmediate_operand to register_operand, remove TARGET_AVX512BW from condition. gcc/testsuite/ChangeLog: * gcc.target/i386/pr104001.c: New test. Diff: --- gcc/config/i386/i386.md | 11 +++++------ gcc/testsuite/gcc.target/i386/pr104001.c | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index c2acb1dbd90..9477ca9b41d 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -10453,9 +10453,9 @@ (set_attr "znver1_decode" "double") (set_attr "mode" "DI")]) -;; PR target/94790: Optimize a ^ ((a ^ b) & mask) to (~mask & a) | (b & mask) +;; Optimize a ^ ((a ^ b) & mask) to (~mask & a) | (b & mask) (define_insn_and_split "*xor2andn" - [(set (match_operand:SWI248 0 "nonimmediate_operand") + [(set (match_operand:SWI248 0 "register_operand") (xor:SWI248 (and:SWI248 (xor:SWI248 @@ -10464,8 +10464,7 @@ (match_operand:SWI248 3 "nonimmediate_operand")) (match_dup 1))) (clobber (reg:CC FLAGS_REG))] - "(TARGET_BMI || TARGET_AVX512BW) - && ix86_pre_reload_split ()" + "TARGET_BMI && ix86_pre_reload_split ()" "#" "&& 1" [(parallel [(set (match_dup 4) @@ -10476,8 +10475,8 @@ (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_dup 5) (and:SWI248 - (match_dup 2) - (match_dup 3))) + (match_dup 3) + (match_dup 2))) (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_dup 0) (ior:SWI248 diff --git a/gcc/testsuite/gcc.target/i386/pr104001.c b/gcc/testsuite/gcc.target/i386/pr104001.c new file mode 100644 index 00000000000..4efb5936dae --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr104001.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-not "kandn" } } */ +/* { dg-final { scan-assembler "andn" } } */ + +int b, c, d; +int r; + +void +__attribute__((target("bmi"))) +foo () +{ + r = ((b & ~d) | (c & d)); +} + +void +__attribute__((target("avx512bw"))) +bar () +{ + r = ((b & ~d) | (c & d)); +}
reply other threads:[~2022-01-14 5:02 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=20220114050240.BE454385841B@sourceware.org \ --to=liuhongt@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: 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).