https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127988
Bug ID: 127988
Summary: [17 Regression] ICE in create_fix_barrier, at
config/arm/minipool.cc:1083
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: yuki.tanaka at defaultcase dot de
Target Milestone: ---
Created attachment 65885
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65885&action=edit
preprocessed source
The following testcase ICEs on current trunk with Thumb-2 at -O2. Checked on
Compiler Explorer (godbolt.org, "ARM GCC trunk (linux)").
min1.c:
#define A *p = v;
#define B A A A A
#define C B B B B
#define D C C C C
#define E D D D D
void f (volatile unsigned long long *q, volatile unsigned *p, unsigned v)
{
*q = 0x0123456789abcdefULL;
E E E D D D C C C B B A
}
Options: -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -O2
Compiler Explorer output:
during RTL pass: mach
<source>: In function 'f':
<source>:11:1: internal compiler error: in create_fix_barrier, at
config/arm/minipool.cc:1083
11 | }
| ^
/cefs/43/43829763186ccf10217e6368_arm_gcc-trunk-20261018/arm-unknown-linux-gnueabihf/bin/../libexec/gcc/arm-unknown-linux-gnueabihf/17.0.0/cc1
-quiet -iprefix
/cefs/43/43829763186ccf10217e6368_arm_gcc-trunk-20261018/arm-unknown-linux-gnueabihf/bin/../lib/gcc/arm-unknown-linux-gnueabihf/17.0.0/
-isysroot
/cefs/43/43829763186ccf10217e6368_arm_gcc-trunk-20261018/arm-unknown-linux-gnueabihf/bin/../arm-unknown-linux-gnueabihf/sysroot
<source> -quiet -dumpdir /app/ -dumpbase output.c -dumpbase-ext .c
-mcpu=cortex-m3 -mthumb -mfloat-abi=soft -mfpu=neon -mtls-dialect=gnu
-mlibarch=armv7-m -march=armv7-m -g -O2 -fdiagnostics-color=always
-fno-verbose-asm -o /app/output.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler version (from -v on the same Compiler Explorer compiler):
Target: arm-unknown-linux-gnueabihf
Configured with: /opt/.build/arm-unknown-linux-gnueabihf/src/gcc/configure
--build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu
--target=arm-unknown-linux-gnueabihf
--prefix=/opt/compiler-explorer/arm/gcc-trunk-20261018/arm-unknown-linux-gnueabihf
--exec_prefix=/opt/compiler-explorer/arm/gcc-trunk-20261018/arm-unknown-linux-gnueabihf
--with-sysroot=/opt/compiler-explorer/arm/gcc-trunk-20261018/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot
--enable-languages=c,c++,fortran --with-arch=armv7-a --with-fpu=neon
--with-float=hard --enable-__cxa_atexit --disable-libmudflap --enable-libgomp
--enable-libssp --enable-libquadmath --enable-libquadmath-support
--enable-libsanitizer --disable-libmpx
--with-gmp=/opt/.build/arm-unknown-linux-gnueabihf/buildtools
--with-mpfr=/opt/.build/arm-unknown-linux-gnueabihf/buildtools
--with-mpc=/opt/.build/arm-unknown-linux-gnueabihf/buildtools
--with-isl=/opt/.build/arm-unknown-linux-gnueabihf/buildtools --enable-lto
--enable-threads=posix --enable-target-optspace --disable-plugin --disable-nls
--disable-multilib
--with-local-prefix=/opt/compiler-explorer/arm/gcc-trunk-20261018/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot
--enable-long-long --with-mode=thumb
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20261018 (experimental) (GCC)
Also ICEs with -O1 and -O3, and with -mcpu=cortex-m4, -mcpu=cortex-m7,
-march=armv8-m.main and -march=armv7-a -mthumb. GCC 16.1, 15.1 and 14.2 compile
it fine.
The ICE depends on the exact code size. It needs the 64-bit constant and
exactly 1017 stores, with 1016 or 1018 it compiles fine. At -Os the magic
number is 1018 instead.
Not bisected, but this is possibly related to
https://gcc.gnu.org/cgit/gcc/commit/?id=53bcce761283ac36217eacfaebae1b98dae49b81
r17-5193-g53bcce761283ac36217eacfaebae1b98dae49b81 ("arm: rework minipool code
to use subpools [PR127227]").