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

            Bug ID: 115881
           Summary: [15 Regression] ICE: RTL check: expected code 'reg',
                    have 'subreg' in rhs_regno, at rtl.h:1934 with -O2
                    -mx32 -maddress-mode=long
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: ice-checking
          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-gnux32

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

This might need RTL checking enabled.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -mx32 -maddress-mode=long testcase.c
testcase.c: In function 'foo':
testcase.c:7:3: warning: '__builtin_memset' writing 940 bytes into a region of
size 4 overflows the destination [-Wstringop-overflow=]
    7 |   __builtin_memset(&i, c, 940);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
testcase.c:6:7: note: destination object 'i' of size 4
    6 |   int i;
      |       ^
during RTL pass: peephole2
testcase.c:9:1: internal compiler error: RTL check: expected code 'reg', have
'subreg' in rhs_regno, at rtl.h:1934
    9 | }
      | ^
0x2a7433b internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0x8167b0 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
        /repo/gcc-trunk/gcc/rtl.cc:770
0xc7f0e6 rhs_regno(rtx_def const*)
        /repo/gcc-trunk/gcc/rtl.h:1934
0xd8470c rhs_regno(rtx_def const*)
        /repo/gcc-trunk/gcc/config/i386/i386.md:1153
0xd8470c peephole2_36
        /repo/gcc-trunk/gcc/config/i386/i386.md:27491
0x1487f14 peephole2_optimize
        /repo/gcc-trunk/gcc/recog.cc:4229
0x1487f14 rest_of_handle_peephole2
        /repo/gcc-trunk/gcc/recog.cc:4380
0x1487f14 execute
        /repo/gcc-trunk/gcc/recog.cc:4417
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-r15-1975-20240711091856-g4e0aa05f67c-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1975-20240711091856-g4e0aa05f67c-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240711 (experimental) (GCC)

Reply via email to