https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101915
Bug ID: 101915
Summary: Microblaze ICE: in extract_insn, at recog.c:2770
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: giulio.benetti at benettiengineering dot com
Target Milestone: ---
When building package lmbench on buildroot we get this error:
'''
/home/giuliobenetti/git/upstream/output-microblaze-lmbench-gcc11/host/bin/microblazeel-buildroot-linux-uclibc-gcc
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g0
-I/home/giuliobenetti/git/upstream/output-microblaze-lmbench-gcc11/host/bin/../microblazeel-buildroot-linux-uclibc/sysroot/usr/include/tirpc
-fno-tree-loop-distribute-patterns -DHAVE_off64_t -DHAVE_lseek64 -DRUSAGE
-DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t
-DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin/microblazeel/stream
stream.c ../bin/microblazeel/lmbench.a
-L/home/giuliobenetti/git/upstream/output-microblaze-lmbench-gcc11/host/bin/../microblazeel-buildroot-linux-uclibc/sysroot/usr/lib
-ltirpc
-L/home/giuliobenetti/git/upstream/output-microblaze-lmbench-gcc11/host/bin/../microblazeel-buildroot-linux-uclibc/sysroot/usr/lib
-ltirpc -lm
par_ops.c: In function ‘int64_bit_2’:
par_ops.c:94:1: error: unrecognizable insn:
94 | }
| ^
par_ops.c:99:9: note: in expansion of macro ‘BENCHMARK’
99 | BENCHMARK(benchmark, 2, REPEAT_2)
\
| ^~~~~~~~~
par_ops.c:215:1: note: in expansion of macro ‘PARALLEL_BENCHMARKS’
215 | PARALLEL_BENCHMARKS(int64_bit)
| ^~~~~~~~~~~~~~~~~~~
(insn 353 354 352 3 (set (reg/v:DI 24 r24 [orig:74 i0 ] [74])
(plus:DI (reg:DI 26 r26 [orig:48 _9 ] [48])
(const_int -1 [0xffffffffffffffff]))) -1
(nil))
during RTL pass: cprop_hardreg
par_ops.c:94:1: internal compiler error: in extract_insn, at recog.c:2770
94 | }
| ^
par_ops.c:99:9: note: in expansion of macro ‘BENCHMARK’
99 | BENCHMARK(benchmark, 2, REPEAT_2)
\
| ^~~~~~~~~
par_ops.c:215:1: note: in expansion of macro ‘PARALLEL_BENCHMARKS’
215 | PARALLEL_BENCHMARKS(int64_bit)
| ^~~~~~~~~~~~~~~~~~~
0x122170e diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char
const*, __va_list_tag (*) [1], diagnostic_t)
???:0
0x12225ce internal_error(char const*, ...)
???:0
0x57a818 fancy_abort(char const*, int, char const*)
???:0
0x55c92f _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
???:0
0x55c951 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
???:0
0x55bc9e extract_insn(rtx_insn*) [clone .cold]
???:0
0xa24fec extract_constrain_insn(rtx_insn*)
???:0
0xa292c7 copyprop_hardreg_forward_1(basic_block_def*, value_data*) [clone
.isra.0]
???:0
0xa29fbd (anonymous namespace)::pass_cprop_hardreg::execute(function*)
???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://bugs.buildroot.net/> for instructions.
make[3]: *** [Makefile:453: ../bin/microblazeel/par_ops] Error 1
make[2]: *** [Makefile:114: lmbench] Error 2
make[1]: *** [package/pkg-generic.mk:270:
/home/giuliobenetti/git/upstream/output-microblaze-lmbench-gcc11/build/lmbench-3.0-a9/.stamp_built]
Error 2
make: *** [Makefile:23: _all] Error 2
'''
To reproduce the bug:
'''
# git clone git://git.busybox.net/buildroot
# wget https://git.busybox.net/buildroot-test/tree/utils/br-reproduce-build
- modify BASE_GIT=... with your buildroot path in br-reproduce-build then:
# chmod a+x br-reproduce-build
# ./br-reproduce-build c6849f0f45b32e1f484fa5442b9d313fff4b2e8c
'''
I've found that it can be worked around disabling the optimization passing -O0
to CFLAGS.