public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/110372] New: [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2
@ 2023-06-22 21:20 zsojka at seznam dot cz
  2023-06-23  2:20 ` [Bug target/110372] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zsojka at seznam dot cz @ 2023-06-22 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110372
           Summary: [14 Regression] ICE: insn does not satisfy its
                    constraints: {*movdi_internal} with -mno-sse2
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mno-sse2 testcase.c
testcase.c: In function 'foo0':
testcase.c:11:1: error: insn does not satisfy its constraints:
   11 | }
      | ^
(insn 36 3 41 2 (set (reg:DI 0 ax [123])
        (reg:DI 20 xmm0 [orig:98 u ] [98])) "testcase.c":9:14 90
{*movdi_internal}
     (nil))
during RTL pass: reload
testcase.c:11:1: internal compiler error: in extract_constrain_insn, at
recog.cc:2692
0x7cc337 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /repo/gcc-trunk/gcc/rtl-error.cc:108
0x7cc3be _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /repo/gcc-trunk/gcc/rtl-error.cc:118
0x7bcc54 extract_constrain_insn(rtx_insn*)
        /repo/gcc-trunk/gcc/recog.cc:2692
0x12476b4 check_rtl
        /repo/gcc-trunk/gcc/lra.cc:2147
0x124be5b lra(_IO_FILE*)
        /repo/gcc-trunk/gcc/lra.cc:2565
0x11fb609 do_reload
        /repo/gcc-trunk/gcc/ira.cc:5967
0x11fb609 execute
        /repo/gcc-trunk/gcc/ira.cc:6153
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-r14-2031-20230622101115-g2ac41866270-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.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
--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-r14-2031-20230622101115-g2ac41866270-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20230622 (experimental) (GCC)

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

* [Bug target/110372] [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2
  2023-06-22 21:20 [Bug target/110372] New: [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2 zsojka at seznam dot cz
@ 2023-06-23  2:20 ` pinskia at gcc dot gnu.org
  2023-06-26  7:22 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-23  2:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

* [Bug target/110372] [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2
  2023-06-22 21:20 [Bug target/110372] New: [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2 zsojka at seznam dot cz
  2023-06-23  2:20 ` [Bug target/110372] " pinskia at gcc dot gnu.org
@ 2023-06-26  7:22 ` ubizjak at gmail dot com
  2023-06-26  7:23 ` [Bug rtl-optimization/110372] " ubizjak at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2023-06-26  7:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
Before reload, we have this sequence:

--cut here--
(insn 34 4 2 2 (set (reg:TI 119)
        (reg:TI 20 xmm0 [ u ])) "pr110372.c":8:1 89 {*movti_internal}
     (expr_list:REG_DEAD (reg:TI 20 xmm0 [ u ])
        (nil)))
(insn 2 34 3 2 (set (reg/v:TI 98 [ u ])
        (reg:TI 119)) "pr110372.c":8:1 89 {*movti_internal}
     (expr_list:REG_DEAD (reg:TI 119)
        (nil)))
(note 3 2 7 2 NOTE_INSN_FUNCTION_BEG)
(insn 7 3 9 2 (set (reg:V4SI 83 [ _2 ])
        (and:V4SI (subreg:V4SI (reg/v:TI 98 [ u ]) 0)
            (mem/u/c:V4SI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [0  S16
A128]))) "pr110372.c":9:14 6840 {*andv4si3}
     (expr_list:REG_EQUAL (and:V4SI (subreg:V4SI (reg/v:TI 98 [ u ]) 0)
            (const_vector:V4SI [
                    (const_int 4 [0x4]) repeated x4
                ]))
        (nil)))
--cut here--

And reload tries to move xmm0 to xmm1 with:

(insn 36 3 41 2 (set (reg:DI 0 ax [123])
        (reg:DI 20 xmm0 [orig:98 u ] [98])) "pr110372.c":9:14 90
{*movdi_internal}
     (nil))
(insn 41 36 37 2 (set (mem/c:TI (plus:DI (reg/f:DI 7 sp)
                (const_int -40 [0xffffffffffffffd8])) [2 %sfp+-32 S16 A128])
        (reg/v:TI 20 xmm0 [orig:98 u ] [98])) "pr110372.c":9:14 89
{*movti_internal}
     (nil))
(insn 37 41 43 2 (set (reg:DI 24 xmm4 [124])
        (mem/c:DI (plus:DI (reg/f:DI 7 sp)
                (const_int -32 [0xffffffffffffffe0])) [2 %sfp+-24 S8 A64]))
"pr110372.c":9:14 90 {*movdi_internal}
     (nil))
(insn 43 37 38 2 (set (reg:DI 23 xmm3 [122])
        (reg:DI 0 ax [123])) "pr110372.c":9:14 90 {*movdi_internal}
     (nil))
(insn 38 43 39 2 (set (reg:V2DI 23 xmm3 [122])
        (vec_concat:V2DI (reg:DI 23 xmm3 [122])
            (reg:DI 24 xmm4 [124]))) "pr110372.c":9:14 7265 {vec_concatv2di}
     (nil))
(insn 39 38 7 2 (set (reg:V4SI 21 xmm1 [orig:83 _2 ] [83])
        (reg:V4SI 23 xmm3 [122])) "pr110372.c":9:14 1869 {movv4si_internal}
     (nil))

in order to satisfy constraints of:

(insn 7 39 9 2 (set (reg:V4SI 21 xmm1 [orig:83 _2 ] [83])
        (and:V4SI (reg:V4SI 21 xmm1 [orig:83 _2 ] [83])
            (mem/u/c:V4SI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [0  S16
A128]))) "pr110372.c":9:14 6840 {*andv4si3}
     (expr_list:REG_EQUAL (and:V4SI (subreg:V4SI (reg/v:TI 20 xmm0 [orig:98 u ]
[98]) 0)
            (const_vector:V4SI [
                    (const_int 4 [0x4]) repeated x4
                ]))
        (nil)))

Please note that alternative 19 of *movdi_internal from i386.md (?r,?v) is
correctly enabled only for x64_sse2 ISA, so unavailable without SSE2.

We have:

#define VALID_SSE_REG_MODE(MODE)                                        \
  ((MODE) == V1TImode || (MODE) == TImode                               \
   || (MODE) == V4SFmode || (MODE) == V4SImode                          \
   || (MODE) == SFmode || (MODE) == SImode                              \
   || (MODE) == TFmode || (MODE) == TDmode)

So, TImode and V4SImode should be tieable for XMM registers and RA should just
copy the value between XMM registers.

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

* [Bug rtl-optimization/110372] [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2
  2023-06-22 21:20 [Bug target/110372] New: [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2 zsojka at seznam dot cz
  2023-06-23  2:20 ` [Bug target/110372] " pinskia at gcc dot gnu.org
  2023-06-26  7:22 ` ubizjak at gmail dot com
@ 2023-06-26  7:23 ` ubizjak at gmail dot com
  2023-07-07 13:58 ` cvs-commit at gcc dot gnu.org
  2023-07-15  6:28 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2023-06-26  7:23 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-06-26
          Component|target                      |rtl-optimization
             Status|UNCONFIRMED                 |NEW
                 CC|                            |vmakarov at gcc dot gnu.org
           Keywords|                            |ra
     Ever confirmed|0                           |1

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
Confirmed as RA problem, CC added.

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

* [Bug rtl-optimization/110372] [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2
  2023-06-22 21:20 [Bug target/110372] New: [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2 zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2023-06-26  7:23 ` [Bug rtl-optimization/110372] " ubizjak at gmail dot com
@ 2023-07-07 13:58 ` cvs-commit at gcc dot gnu.org
  2023-07-15  6:28 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-07 13:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Vladimir Makarov <vmakarov@gcc.gnu.org>:

https://gcc.gnu.org/g:1f7e5a7b91862b999aab88ee0319052aaf00f0f1

commit r14-2380-g1f7e5a7b91862b999aab88ee0319052aaf00f0f1
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Fri Jul 7 09:53:38 2023 -0400

    LRA: Refine reload pseudo class

    For given testcase a reload pseudo happened to occur only in reload
    insns created on one constraint sub-pass.  Therefore its initial class
    (ALL_REGS) was not refined and the reload insns were not processed on
    the next constraint sub-passes.  This resulted into the wrong insn.

            PR rtl-optimization/110372

    gcc/ChangeLog:

            * lra-assigns.cc (assign_by_spills): Add reload insns involving
            reload pseudos with non-refined class to be processed on the next
            sub-pass.
            * lra-constraints.cc (enough_allocatable_hard_regs_p): New func.
            (in_class_p): Use it.
            (print_curr_insn_alt): New func.
            (process_alt_operands): Use it.  Improve debug info.
            (curr_insn_transform): Use print_curr_insn_alt.  Refine reload
            pseudo class if it is not refined yet.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr110372.c: New.

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

* [Bug rtl-optimization/110372] [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2
  2023-06-22 21:20 [Bug target/110372] New: [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2 zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2023-07-07 13:58 ` cvs-commit at gcc dot gnu.org
@ 2023-07-15  6:28 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-15  6:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-07-15  6:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-22 21:20 [Bug target/110372] New: [14 Regression] ICE: insn does not satisfy its constraints: {*movdi_internal} with -mno-sse2 zsojka at seznam dot cz
2023-06-23  2:20 ` [Bug target/110372] " pinskia at gcc dot gnu.org
2023-06-26  7:22 ` ubizjak at gmail dot com
2023-06-26  7:23 ` [Bug rtl-optimization/110372] " ubizjak at gmail dot com
2023-07-07 13:58 ` cvs-commit at gcc dot gnu.org
2023-07-15  6:28 ` pinskia 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).