https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100305
Bug ID: 100305
Summary: ICE in output_operand_lossage with -march=armv8.2-a
-O3
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gilles.gouaillardet at gmail dot com
Target Milestone: ---
Created attachment 50696
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50696&action=edit
a (compressed) preprocessed reproducer
This is a new bug with the g++ compiler I found when building GROMACS on
aarch64 with -O3.
-O2 works fine, and so does x86_64. I was only able to reproduce the issue on
aarch64 (initially with SVE, but same outcome without it)
The compiler crashed with the following stack trace:
$ ~/local/gcc-latest/bin/g++ -c -O3 -march=armv8.2-a readpull.i
during RTL pass: final
readpull.cpp: In function 'std::vector<std::__cxx11::basic_string<char> >
read_pullparams(std::vector<t_inpfile>*, pull_params_t*, warninp_t)':
readpull.cpp:96:1: internal compiler error: output_operand: invalid expression
as operand
96 | }
| ^
0xc66ab7 output_operand_lossage(char const*, ...)
../../../src/gcc-latest/gcc/final.c:3627
0xc67283 output_addr_const(_IO_FILE*, rtx_def*)
../../../src/gcc-latest/gcc/final.c:4184
0xc66d0f output_address(machine_mode, rtx_def*)
../../../src/gcc-latest/gcc/final.c:4085
0xc66c4b output_operand(rtx_def*, int)
../../../src/gcc-latest/gcc/final.c:4069
0xc6769f output_asm_insn(char const*, rtx_def**)
../../../src/gcc-latest/gcc/final.c:3981
0xc6b84f output_asm_insn(char const*, rtx_def**)
../../../src/gcc-latest/gcc/final.c:3858
0xc6b84f final_scan_insn_1
../../../src/gcc-latest/gcc/final.c:3125
0xc6be43 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../../src/gcc-latest/gcc/final.c:3171
0xc6bf63 final_1
../../../src/gcc-latest/gcc/final.c:2022
0xc6cc0b rest_of_handle_final
../../../src/gcc-latest/gcc/final.c:4676
0xc6cc0b execute
../../../src/gcc-latest/gcc/final.c:4754
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.