public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-4454] Fix ICE due to incorrect insn type.
@ 2022-12-02  1:29 hongtao Liu
  0 siblings, 0 replies; only message in thread
From: hongtao Liu @ 2022-12-02  1:29 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e055e6db974d8b8950b30859a853e0aee74e20c2

commit r13-4454-ge055e6db974d8b8950b30859a853e0aee74e20c2
Author: liuhongt <hongtao.liu@intel.com>
Date:   Thu Dec 1 11:41:49 2022 +0800

    Fix ICE due to incorrect insn type.
    
    ;; if reg/mem op
    (define_insn_reservation  "slm_sseishft_3" 2
      (and (eq_attr "cpu" "slm")
           (and (eq_attr "type" "sseishft")
                (not (match_operand 2 "immediate_operand"))))
      "slm-complex, slm-all-eu")
    
    in slm.md it will check operands[2] for type sseishft, but for
    extendbfsf2_1 there's no second operand which caused ICE.
    The patch set type from sseishft to sseishft1 to fix the issue.
    
    gcc/ChangeLog:
    
            PR target/107934
            * config/i386/i386.md (extendbfsf2_1): Change type from
            sseishft to sseishft1.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/i386/pr107934.c: New test.

Diff:
---
 gcc/config/i386/i386.md                  | 2 +-
 gcc/testsuite/gcc.target/i386/pr107934.c | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index e9ca7f3f1ad..2975b5e96f8 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -4981,7 +4981,7 @@
   pslld\t{$16, %0|%0, 16}
   vpslld\t{$16, %1, %0|%0, %1, 16}"
   [(set_attr "isa" "noavx,avx")
-   (set_attr "type" "sseishft")
+   (set_attr "type" "sseishft1")
    (set_attr "length_immediate" "1")
    (set_attr "prefix_data16" "1,*")
    (set_attr "prefix" "orig,vex")
diff --git a/gcc/testsuite/gcc.target/i386/pr107934.c b/gcc/testsuite/gcc.target/i386/pr107934.c
new file mode 100644
index 00000000000..59106b29159
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr107934.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mtune=knl -ffinite-math-only -msse2" } */
+
+int
+foo (__bf16 bf)
+{
+  return bf;
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-02  1:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02  1:29 [gcc r13-4454] Fix ICE due to incorrect insn type hongtao Liu

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).