https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113510
Bug ID: 113510
Summary: [ARM Thumb] ICE in extract_constrain_insn with CPU
cortex-m23
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: thiago.bauermann at linaro dot org
Target Milestone: ---
Created attachment 57167
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57167&action=edit
Preprocessed version of nested-3.c
After commit a729b6e002fe ("[PR112918][LRA]: Fixing IRA ICE on m68k"), the
following failures started appearing on --target=arm-none-eabi
--with-mode=thumb --with-cpu=cortex-m23:
=== gcc tests ===
Running gcc:gcc.c-torture/compile/compile.exp ...
FAIL: gcc.c-torture/compile/nested-3.c -O2 (internal compiler error: in
extract_constrain_insn, at recog.cc:2713)
FAIL: gcc.c-torture/compile/nested-3.c -O2 (test for excess errors)
FAIL: gcc.c-torture/compile/nested-3.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none (internal compiler error: in extract_constrain_insn, at
recog.cc:2713)
FAIL: gcc.c-torture/compile/nested-3.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none (test for excess errors)
FAIL: gcc.c-torture/compile/nested-3.c -O3 -g (internal compiler error: in
extract_constrain_insn, at recog.cc:2713)
FAIL: gcc.c-torture/compile/nested-3.c -O3 -g (test for excess errors)
FAIL: gcc.c-torture/compile/nested-3.c -Os (internal compiler error: in
extract_constrain_insn, at recog.cc:2713)
FAIL: gcc.c-torture/compile/nested-3.c -Os (test for excess errors)
Running gcc:gcc.c-torture/execute/execute.exp ...
FAIL: gcc.c-torture/execute/pr71494.c -O2 (internal compiler error: in
extract_constrain_insn, at recog.cc:2713)
FAIL: gcc.c-torture/execute/pr71494.c -O2 (test for excess errors)
UNRESOLVED: gcc.c-torture/execute/pr71494.c -O2 compilation failed to produce
executable
FAIL: gcc.c-torture/execute/pr71494.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none (internal compiler error: in extract_constrain_insn, at
recog.cc:2713)
FAIL: gcc.c-torture/execute/pr71494.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none (test for excess errors)
UNRESOLVED: gcc.c-torture/execute/pr71494.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none compilation failed to produce executable
FAIL: gcc.c-torture/execute/pr71494.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects (internal compiler error: in extract_constrain_insn, at
recog.cc:2713)
FAIL: gcc.c-torture/execute/pr71494.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects (test for excess errors)
UNRESOLVED: gcc.c-torture/execute/pr71494.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects compilation failed to produce executable
FAIL: gcc.c-torture/execute/pr71494.c -O3 -g (internal compiler error: in
extract_constrain_insn, at recog.cc:2713)
FAIL: gcc.c-torture/execute/pr71494.c -O3 -g (test for excess errors)
UNRESOLVED: gcc.c-torture/execute/pr71494.c -O3 -g compilation failed to
produce executable
FAIL: gcc.c-torture/execute/pr71494.c -Os (internal compiler error: in
extract_constrain_insn, at recog.cc:2713)
FAIL: gcc.c-torture/execute/pr71494.c -Os (test for excess errors)
UNRESOLVED: gcc.c-torture/execute/pr71494.c -Os compilation failed to produce
executable
I tested on today's trunk (commit 07b392550f37) and the failures are still
present. I'm attaching the gcc.{sum,log} files, and also the .i file that
causes the ICE.
Here's how to reproduce on an x86_64-linux machine:
1. First, create a combined tree:
$ mkdir /tmp/combined-tree-src /tmp/combined-tree-build
$ cd ~/src/newlib-cygwin && find . -print | cpio -pdlm /tmp/combined-tree-src
$ cd ~/src/binutils-gdb && find . -print | cpio -pdlmu /tmp/combined-tree-src
$ cd ~/src/gcc && find . -print | cpio -pdlmu /tmp/combined-tree-src
2. Then build and install the cross GCC:
$ cd /tmp/combined-tree-build
$ /tmp/combined-tree-src/configure \
SHELL=/bin/bash \
--with-gnu-as \
--with-gnu-ld \
--disable-libmudflap \
--enable-lto \
--enable-shared \
--without-included-gettext \
--enable-nls \
--with-system-zlib \
--disable-sjlj-exceptions \
--enable-gnu-unique-object \
--enable-linker-build-id \
--disable-libstdcxx-pch \
--enable-c99 \
--enable-clocale=gnu \
--enable-libstdcxx-debug \
--enable-long-long \
--with-cloog=no \
--with-ppl=no \
--with-isl=no \
--enable-threads=no \
--disable-multiarch \
--disable-multilib \
--with-mode=thumb \
--with-cpu=cortex-m23 \
--with-float=soft \
--with-newlib \
--with-headers=yes \
--with-native-system-header-dir=/include \
--enable-checking=yes \
--disable-bootstrap \
--enable-languages=c,lto \
--prefix=/tmp/arm-none-eabi \
--build=x86_64-pc-linux-gnu \
--host=x86_64-pc-linux-gnu \
--disable-source-highlight \
--target=arm-none-eabi \
&& exec make \
SHELL=/bin/bash \
-w \
-j $(nproc) \
LDFLAGS_FOR_TARGET="--specs=rdimon.specs" \
CFLAGS_FOR_BUILD="-pipe -g -O2" \
CXXFLAGS_FOR_BUILD="-pipe -g -O2" \
LDFLAGS_FOR_BUILD="-static-libgcc" \
MAKEINFOFLAGS=--force \
BUILD_INFO="" \
MAKEINFO=echo \
&& make install
3. Finally, use it to compile the problematic .c files:
$ /tmp/arm-none-eabi/bin/arm-none-eabi-gcc -fdiagnostics-plain-output -O2 -w -c
-o nested-3.o
/tmp/combined-tree-src/gcc/testsuite/gcc.c-torture/compile/nested-3.c
/tmp/combined-tree-src/gcc/testsuite/gcc.c-torture/compile/nested-3.c: In
function ‘f’:
/tmp/combined-tree-src/gcc/testsuite/gcc.c-torture/compile/nested-3.c:18:1:
error: insn does not satisfy its constraints:
(insn 39 13 16 2 (set (reg:SI 12 ip [127])
(plus:SI (reg/f:SI 13 sp)
(const_int 8 [0x8])))
"/tmp/combined-tree-src/gcc/testsuite/gcc.c-torture/compile/nested-3.c":17:10
935 {*thumb1_addsi3}
(nil))
during RTL pass: cprop_hardreg
/tmp/combined-tree-src/gcc/testsuite/gcc.c-torture/compile/nested-3.c:18:1:
internal compiler error: in extract_constrain_insn, at recog.cc:2713
0x744632 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../combined-tree/gcc/rtl-error.cc:108
0x74465e _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../combined-tree/gcc/rtl-error.cc:118
0x7430fb extract_constrain_insn(rtx_insn*)
../../combined-tree/gcc/recog.cc:2713
0xef7636 copyprop_hardreg_forward_1
../../combined-tree/gcc/regcprop.cc:836
0xef8784 execute
../../combined-tree/gcc/regcprop.cc:1423
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.
$ /tmp/arm-none-eabi/bin/arm-none-eabi-gcc
/tmp/combined-tree-src/gcc/testsuite/gcc.c-torture/execute/pr71494.c
-fdiagnostics-plain-output -O2 -w
-B/tmp/combined-tree-build/arm-none-eabi/./libgloss/arm/
-L/tmp/combined-tree-build/arm-none-eabi/./libgloss/arm
-L/tmp/combined-tree-src/libgloss/arm -L/tmp/combined-tree-build/ld
-B/tmp/combined-tree-build/arm-none-eabi/./newlib/
-L/tmp/combined-tree-build/arm-none-eabi/./newlib -specs=rdimon.specs -lm -o
./pr71494.exe
/tmp/combined-tree-src/gcc/testsuite/gcc.c-torture/execute/pr71494.c: In
function ‘main’:
/tmp/combined-tree-src/gcc/testsuite/gcc.c-torture/execute/pr71494.c:23:1:
error: insn does not satisfy its constraints:
(insn 64 9 12 2 (set (reg:SI 12 ip [123])
(plus:SI (reg/f:SI 13 sp)
(const_int 4 [0x4])))
"/tmp/combined-tree-src/gcc/testsuite/gcc.c-torture/execute/pr71494.c":19:3 935
{*thumb1_addsi3}
(nil))
during RTL pass: cprop_hardreg
/tmp/combined-tree-src/gcc/testsuite/gcc.c-torture/execute/pr71494.c:23:1:
internal compiler error: in extract_constrain_insn, at recog.cc:2713
0x744632 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../combined-tree/gcc/rtl-error.cc:108
0x74465e _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../combined-tree/gcc/rtl-error.cc:118
0x7430fb extract_constrain_insn(rtx_insn*)
../../combined-tree/gcc/recog.cc:2713
0xef7636 copyprop_hardreg_forward_1
../../combined-tree/gcc/regcprop.cc:836
0xef8784 execute
../../combined-tree/gcc/regcprop.cc:1423
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.