public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/107185] New: [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf()
@ 2022-10-08 13:06 zsojka at seznam dot cz
  2022-10-09  4:33 ` [Bug target/107185] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2022-10-08 13:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107185

            Bug ID: 107185
           Summary: [13 Regression] during RTL pass: vregs ICE: in
                    extract_insn, at recog.cc:2791 (unrecognizable insn)
                    with -ffast-math and lrintf()
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 53680
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53680&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -ffast-math testcase.c
testcase.c: In function 'foo':
testcase.c:5:1: error: unrecognizable insn:
    5 | }
      | ^
(insn 7 6 0 2 (set (mem/c:DI (plus:DI (reg/f:DI 77 virtual-stack-vars)
                (const_int -8 [0xfffffffffffffff8])) [1 l+0 S8 A64])
        (unspec:DI [
                (reg:SF 82)
            ] UNSPEC_FIX_NOTRUNC)) "testcase.c":4:12 -1
     (nil))
during RTL pass: vregs
testcase.c:5:1: internal compiler error: in extract_insn, at recog.cc:2791
0x782279 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /repo/gcc-trunk/gcc/rtl-error.cc:108
0x7822f5 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /repo/gcc-trunk/gcc/rtl-error.cc:116
0x770eaa extract_insn(rtx_insn*)
        /repo/gcc-trunk/gcc/recog.cc:2791
0x103f6c9 instantiate_virtual_regs_in_insn
        /repo/gcc-trunk/gcc/function.cc:1611
0x103f6c9 instantiate_virtual_regs
        /repo/gcc-trunk/gcc/function.cc:1985
0x103f6c9 execute
        /repo/gcc-trunk/gcc/function.cc:2034
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r13-3175-20221007202551-g6ffbf87ca66-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r13-3175-20221007202551-g6ffbf87ca66-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.0 20221008 (experimental) (GCC)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/107185] [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf()
  2022-10-08 13:06 [Bug target/107185] New: [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf() zsojka at seznam dot cz
@ 2022-10-09  4:33 ` pinskia at gcc dot gnu.org
  2022-10-09  6:33 ` crazylht at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-09  4:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107185

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/107185] [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf()
  2022-10-08 13:06 [Bug target/107185] New: [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf() zsojka at seznam dot cz
  2022-10-09  4:33 ` [Bug target/107185] " pinskia at gcc dot gnu.org
@ 2022-10-09  6:33 ` crazylht at gmail dot com
  2022-10-10  7:58 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: crazylht at gmail dot com @ 2022-10-09  6:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107185

--- Comment #1 from Hongtao.liu <crazylht at gmail dot com> ---
Looks like there's mismatch between

20147(define_expand "lrint<MODEF:mode><SWI48:mode>2"
20148  [(set (match_operand:SWI48 0 "nonimmediate_operand")
20149     (unspec:SWI48 [(match_operand:MODEF 1 "register_operand")]
20150                   UNSPEC_FIX_NOTRUNC))]
20151  "SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH")

and

7770(define_insn "sse_cvtss2si<rex64namesuffix>_2"
 7771  [(set (match_operand:SWI48 0 "register_operand" "=r,r")
 7772        (unspec:SWI48 [(match_operand:SF 1 "nonimmediate_operand" "v,m")]
 7773                      UNSPEC_FIX_NOTRUNC))]
...
...
 8215(define_insn "sse2_cvtsd2si<rex64namesuffix>_2"
 8216  [(set (match_operand:SWI48 0 "register_operand" "=r,r")
 8217        (unspec:SWI48 [(match_operand:DF 1 "nonimmediate_operand" "v,m")]
 8218                      UNSPEC_FIX_NOTRUNC))]
 8219  "TARGET_SSE2"
 8220  "%vcvtsd2si<rex64suffix>\t{%1, %0|%0, %q1}"

Need to swap predicates for operands[0] and operand[1] of
"lrint<MODEF:mode><SWI48:mode>2"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/107185] [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf()
  2022-10-08 13:06 [Bug target/107185] New: [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf() zsojka at seznam dot cz
  2022-10-09  4:33 ` [Bug target/107185] " pinskia at gcc dot gnu.org
  2022-10-09  6:33 ` crazylht at gmail dot com
@ 2022-10-10  7:58 ` cvs-commit at gcc dot gnu.org
  2022-10-10  7:59 ` crazylht at gmail dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-10  7:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107185

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>:

https://gcc.gnu.org/g:9b8520fa9d745b3a974d5eb98cb4b9a9021b215d

commit r13-3189-g9b8520fa9d745b3a974d5eb98cb4b9a9021b215d
Author: liuhongt <hongtao.liu@intel.com>
Date:   Sun Oct 9 15:30:10 2022 +0800

    Fix unrecognizable insn of cvtss2si.

    Adjust lrintmn2 operand preidcates according to real instructions.

    gcc/ChangeLog:

            PR target/107185
            * config/i386/i386.md (lrint<MODEF:mode><SWI48:mode>2): Swap
            predicate of operands[0] and operands[1].

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr107185.c: New test.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/107185] [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf()
  2022-10-08 13:06 [Bug target/107185] New: [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf() zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2022-10-10  7:58 ` cvs-commit at gcc dot gnu.org
@ 2022-10-10  7:59 ` crazylht at gmail dot com
  2022-10-11 13:58 ` cvs-commit at gcc dot gnu.org
  2022-11-24 11:15 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: crazylht at gmail dot com @ 2022-10-10  7:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107185

--- Comment #3 from Hongtao.liu <crazylht at gmail dot com> ---
Fixed in GCC13.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/107185] [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf()
  2022-10-08 13:06 [Bug target/107185] New: [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf() zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2022-10-10  7:59 ` crazylht at gmail dot com
@ 2022-10-11 13:58 ` cvs-commit at gcc dot gnu.org
  2022-11-24 11:15 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-11 13:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107185

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

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

commit r13-3232-gb65945e7fb8d0f6cf911d371926d25e7ea82db62
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Oct 11 15:57:09 2022 +0200

    i386: Fix up RTL checking ICE [PR107185]

    On Tue, Oct 11, 2022 at 04:03:16PM +0800, liuhongt via Gcc-patches wrote:
    > gcc/ChangeLog:
    >
    >       * config/i386/i386.md (*notxor<mode>_1): New post_reload
    >       define_insn_and_split.
    >       (*notxorqi_1): Ditto.

    > --- a/gcc/config/i386/i386.md
    > +++ b/gcc/config/i386/i386.md
    > @@ -10826,6 +10826,39 @@ (define_insn "*<code><mode>_1"
    >     (set_attr "type" "alu, alu, msklog")
    >     (set_attr "mode" "<MODE>")])
    >
    > +(define_insn_and_split "*notxor<mode>_1"
    > +  [(set (match_operand:SWI248 0 "nonimmediate_operand" "=rm,r,?k")
    > +     (not:SWI248
    > +       (xor:SWI248
    > +         (match_operand:SWI248 1 "nonimmediate_operand" "%0,0,k")
    > +         (match_operand:SWI248 2 "<general_operand>" "r<i>,<m>,k"))))
    > +   (clobber (reg:CC FLAGS_REG))]
    > +  "ix86_binary_operator_ok (XOR, <MODE>mode, operands)"
    > +  "#"
    > +  "&& reload_completed"
    > +  [(parallel
    > +    [(set (match_dup 0)
    > +       (xor:SWI248 (match_dup 1) (match_dup 2)))
    > +     (clobber (reg:CC FLAGS_REG))])
    > +   (set (match_dup 0)
    > +     (not:SWI248 (match_dup 1)))]
    > +{
    > +  if (MASK_REGNO_P (REGNO (operands[0])))

    This causes --enable-checking=yes,rtl,extra regression on
    gcc.dg/store_merging_13.c test on x86_64-linux:
    .../gcc/testsuite/gcc.dg/store_merging_13.c: In function 'f13':
    .../gcc/testsuite/gcc.dg/store_merging_13.c:189:1: internal compiler error:
RTL check: expected code 'reg', have 'mem' in rhs_regno, at rtl.h:1932
    0x7b0c8f rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
            ../../gcc/rtl.cc:916
    0x8e74be rhs_regno
            ../../gcc/rtl.h:1932
    0x9785fd rhs_regno
            ./genrtl.h:120
    0x9785fd gen_split_260(rtx_insn*, rtx_def**)
            ../../gcc/config/i386/i386.md:10846
    0x23596dc split_insns(rtx_def*, rtx_insn*)
            ../../gcc/config/i386/i386.md:16392
    0xfccd5a try_split(rtx_def*, rtx_insn*, int)
            ../../gcc/emit-rtl.cc:3799
    0x132e9d8 split_insn
            ../../gcc/recog.cc:3384
    0x13359d5 split_all_insns()
            ../../gcc/recog.cc:3488
    0x1335ae8 execute
            ../../gcc/recog.cc:4412
    Please submit a full bug report, with preprocessed source (by using
-freport-bug).
    Please include the complete backtrace with any bug report.
    See <https://gcc.gnu.org/bugs/> for instructions.

    Fixed thusly.

    2022-10-11  Jakub Jelinek  <jakub@redhat.com>

            PR target/107185
            * config/i386/i386.md (*notxor<mode>_1): Use MASK_REG_P (x) instead
of
            MASK_REGNO_P (REGNO (x)).

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/107185] [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf()
  2022-10-08 13:06 [Bug target/107185] New: [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf() zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2022-10-11 13:58 ` cvs-commit at gcc dot gnu.org
@ 2022-11-24 11:15 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-11-24 11:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107185

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-24 11:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-08 13:06 [Bug target/107185] New: [13 Regression] during RTL pass: vregs ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffast-math and lrintf() zsojka at seznam dot cz
2022-10-09  4:33 ` [Bug target/107185] " pinskia at gcc dot gnu.org
2022-10-09  6:33 ` crazylht at gmail dot com
2022-10-10  7:58 ` cvs-commit at gcc dot gnu.org
2022-10-10  7:59 ` crazylht at gmail dot com
2022-10-11 13:58 ` cvs-commit at gcc dot gnu.org
2022-11-24 11:15 ` jakub at gcc dot gnu.org

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