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

            Bug ID: 128563
           Summary: [17 Regression] mips: ICE: maximum number of generated
                    reload insns per insn achieved (90)
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: julius at bairaktaris dot de
  Target Milestone: ---

A 32x32->64 widening multiply ICEs in LRA at -O1 on 32-bit MIPS:

$ cat mul.c
long long
f (int x, int y)
{
  return (long long) x * y;
}
$ mipsel-linux-musl-gcc -O1 -S mul.c
during RTL pass: reload
mul.c: In function 'f':
mul.c:5:1: internal compiler error: maximum number of generated reload insns
per insn achieved (90)
    5 | }
      | ^
0x2329eeb internal_error(char const*, ...)
        gcc/diagnostic-global-context.cc:787
0xf189f3 lra_constraints(bool)
        gcc/lra-constraints.cc:6194
0xefa9d2 lra(_IO_FILE*, int)
        gcc/lra.cc:2511
0xeaaeaf do_reload
        gcc/ira.cc:6097
0xeaaeaf execute
        gcc/ira.cc:6285

cc1 command line from the driver:

cc1 -quiet mul.c -mel -quiet -dumpbase mul.c -dumpbase-ext .c -march=mips32r2
-mllsc -mips32r2 -mno-shared -mabi=32 -O1

It ICEs with -march=mips32, -march=mips32r2 and -march=mips64r2 -mabi=32,
little- and
big-endian (-meb).  It compiles with -O2, -march=mips1, -march=mips32r6 and
-mips16.
releases/gcc-16 (r16-9924-g43971276091) built with the same configuration
compiles the
testcase with every one of these options.

The same ICE breaks the libgcc build on master: libgcc2.c fails in __divdi3,
__moddi3,
__udivdi3, __umoddi3, __udivmoddi4 and __divmoddi4 (compiled with -O2
-minterlink-mips16
-fPIC); __umoddi3 still ICEs at plain -O1.

In gcc.target/mips/mips.exp, 73 tests ICE this way on master (attached list):
madd-3.c,
madd-5.c, madd-8.c, madd-9.c, mips-sched-madd.c, msub-5.c, msub-8.c,
octeon-pipe-1.c,
octeon2-pipe-1.c, octeon3-pipe-1.c, pr100762.c, truncate-6.c, vr-mult-1.c,
vr-mult-2.c.
None of them ICEs on releases/gcc-16 with the same build.

gcc -v:

Target: mipsel-linux-musl
Configured with: ../configure --target=mipsel-linux-musl --with-sysroot=<musl
sysroot> --with-arch=mips32r2 --enable-languages=c,c++ --disable-multilib
--disable-bootstrap --disable-nls --disable-shared --disable-libsanitizer
--disable-libssp --disable-libquadmath --disable-libgomp --disable-libatomic
--disable-libitm --disable-libvtv --disable-libstdcxx --disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20261108 (experimental) (GCC)

Binutils: GNU assembler/linker 2.45.90 (--with-as/--with-ld).

Reply via email to