public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zsojka at seznam dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/111259] New: [14 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1934 during riscv64 build
Date: Thu, 31 Aug 2023 18:22:41 +0000	[thread overview]
Message-ID: <bug-111259-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 111259
           Summary: [14 Regression] ICE: RTL check: expected code 'reg',
                    have 'subreg' in rhs_regno, at rtl.h:1934 during
                    riscv64 build
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: build, ice-checking, 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: riscv64-unknown-linux-gnu
             Build: x86_64-pc-linux-gnu

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

Building GCC for the riscv64-unknown-linux-gnu target with RTL checking enabled
fails during libgcc build:

$ make
# If this is the top-level multilib, build all the other
# multilibs.
/repo/build-gcc-trunk-riscv64/./gcc/xgcc -B/repo/build-gcc-trunk-riscv64/./gcc/
-B/repo/gcc-trunk//binary-trunk-r14-3602-20230831181644-ga335cf241b9-checking-yes-rtl-df-extra-riscv64/riscv64-unknown-linux-gnu/bin/
-B/repo/gcc-trunk//binary-trunk-r14-3602-20230831181644-ga335cf241b9-checking-yes-rtl-df-extra-riscv64/riscv64-unknown-linux-gnu/lib/
-isystem
/repo/gcc-trunk//binary-trunk-r14-3602-20230831181644-ga335cf241b9-checking-yes-rtl-df-extra-riscv64/riscv64-unknown-linux-gnu/include
-isystem
/repo/gcc-trunk//binary-trunk-r14-3602-20230831181644-ga335cf241b9-checking-yes-rtl-df-extra-riscv64/riscv64-unknown-linux-gnu/sys-include
   -g -O2 -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g
-DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -fPIC -I. -I.
-I../.././gcc -I/repo/gcc-trunk/libgcc -I/repo/gcc-trunk/libgcc/.
-I/repo/gcc-trunk/libgcc/../gcc -I/repo/gcc-trunk/libgcc/../include 
-DHAVE_CC_TLS  -Wno-missing-prototypes -Wno-type-limits  -o fixunshfti.o -MT
fixunshfti.o -MD -MP -MF fixunshfti.dep  -c
/repo/gcc-trunk/libgcc/soft-fp/fixunshfti.c -fvisibility=hidden -DHIDE_EXPORTS
during RTL pass: combine
/repo/gcc-trunk/libgcc/soft-fp/fixunshfti.c: In function '__fixunshfti':
/repo/gcc-trunk/libgcc/soft-fp/fixunshfti.c:45:1: internal compiler error: RTL
check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1934
   45 | }
      | ^
0x90f65c rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
        /repo/gcc-trunk/gcc/rtl.cc:770
0xb7b026 rhs_regno(rtx_def const*)
        /repo/gcc-trunk/gcc/rtl.h:1934
0xb7b132 rhs_regno(rtx_def const*)
        /repo/gcc-trunk/gcc/common.md:26
0xb7b132 zcmp_mv_sreg_operand(rtx_def*, machine_mode)
        /repo/gcc-trunk/gcc/config/riscv/predicates.md:180
0x2236a11 recog_564
        /repo/gcc-trunk/gcc/config/riscv/iterators.md:60
0x2249d2b recog(rtx_def*, rtx_insn*, int*)
        /repo/gcc-trunk/gcc/config/riscv/iterators.md:58
0x227e442 recog_for_combine_1
        /repo/gcc-trunk/gcc/combine.cc:11382
0x22819de recog_for_combine
        /repo/gcc-trunk/gcc/combine.cc:11652
0x229c022 try_combine
        /repo/gcc-trunk/gcc/combine.cc:3546
0x22a1544 combine_instructions
        /repo/gcc-trunk/gcc/combine.cc:1264
0x22a1544 rest_of_handle_combine
        /repo/gcc-trunk/gcc/combine.cc:15063
0x22a1544 execute
        /repo/gcc-trunk/gcc/combine.cc:15107
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.
make: *** [/repo/gcc-trunk/libgcc/shared-object.mk:14: fixunshfti.o] Error 1


$ /repo/build-gcc-trunk-riscv64/./gcc/cc1 -O -march=rv64imafdc -mabi=lp64d
testcase.c 
 __fixunshfti
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> {heap 872k} <visibility> {heap 872k} <build_ssa_passes>
{heap 872k} <opt_local_passes> {heap 1148k} <remove_symbols> {heap 1608k}
<targetclone> {heap 1608k} <free-fnsummary> {heap 1608k}Streaming LTO
 <whole-program> {heap 1608k} <profile_estimate> {heap 1608k} <fnsummary> {heap
1608k} <inline> {heap 1608k} <pure-const> {heap 1608k} <modref> {heap 1608k}
<free-fnsummary> {heap 1608k} <static-var> {heap 1608k} <single-use> {heap
1608k} <comdats> {heap 1608k}Assembling functions:
 __fixunshftiduring RTL pass: combine

testcase.c: In function '__fixunshfti':
testcase.c:10:1: internal compiler error: RTL check: expected code 'reg', have
'subreg' in rhs_regno, at rtl.h:1934
   10 | }
      | ^
0x90f65c rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
        /repo/gcc-trunk/gcc/rtl.cc:770
0xb7b026 rhs_regno(rtx_def const*)
        /repo/gcc-trunk/gcc/rtl.h:1934
0xb7b132 rhs_regno(rtx_def const*)
        /repo/gcc-trunk/gcc/common.md:26
0xb7b132 zcmp_mv_sreg_operand(rtx_def*, machine_mode)
        /repo/gcc-trunk/gcc/config/riscv/predicates.md:180
0x2236a11 recog_564
        /repo/gcc-trunk/gcc/config/riscv/iterators.md:60
0x2249d2b recog(rtx_def*, rtx_insn*, int*)
        /repo/gcc-trunk/gcc/config/riscv/iterators.md:58
0x227e442 recog_for_combine_1
        /repo/gcc-trunk/gcc/combine.cc:11382
0x22819de recog_for_combine
        /repo/gcc-trunk/gcc/combine.cc:11652
0x229c022 try_combine
        /repo/gcc-trunk/gcc/combine.cc:3546
0x22a1544 combine_instructions
        /repo/gcc-trunk/gcc/combine.cc:1264
0x22a1544 rest_of_handle_combine
        /repo/gcc-trunk/gcc/combine.cc:15063
0x22a1544 execute
        /repo/gcc-trunk/gcc/combine.cc:15107
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.



$ /repo/build-gcc-trunk-riscv64/./gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=/repo/build-gcc-trunk-riscv64/./gcc/xgcc
Target: riscv64-unknown-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 --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-3602-20230831181644-ga335cf241b9-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20230831 (experimental) (GCC)

             reply	other threads:[~2023-08-31 18:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 18:22 zsojka at seznam dot cz [this message]
2023-08-31 18:24 ` [Bug target/111259] " pinskia at gcc dot gnu.org
2023-09-15 20:44 ` cvs-commit at gcc dot gnu.org
2023-10-17 12:29 ` rguenth 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-111259-4@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: link
Be 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).