https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103397
Bug ID: 103397
Summary: [12 Regression] GCN target '-march=gfx900' libgfortran
build broken
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: tschwinge at gcc dot gnu.org
CC: ams at gcc dot gnu.org, jules at gcc dot gnu.org
Target Milestone: ---
Target: GCN
GCN target '-march=gfx900' libgfortran build broken:
[xgcc] [...] -march=gfx900 [...] -c
[...]/source-gcc/libgfortran/runtime/environ.c -o environ.o
In file included from [...]/source-gcc/libgfortran/runtime/environ.c:29:
[...]/source-gcc/libgfortran/runtime/environ.c: In function ‘init_integer’:
[...]/source-gcc/libgfortran/runtime/environ.c:94:19: warning: array
subscript has type ‘char’ [-Wchar-subscripts]
94 | if (!isdigit (*q) && (p != q || *q != '-'))
| ^~
[...]/source-gcc/libgfortran/runtime/environ.c: In function
‘match_integer’:
[...]/source-gcc/libgfortran/runtime/environ.c:347:19: warning: array
subscript has type ‘char’ [-Wchar-subscripts]
347 | while (isdigit (*p))
| ^~
during RTL pass: pro_and_epilogue
[...]/source-gcc/libgfortran/runtime/environ.c: In function ‘search_unit’:
[...]/source-gcc/libgfortran/runtime/environ.c:319:1: internal compiler
error: RTL check: access of elt 4 of vector with last elt 3 in
move_callee_saved_registers, at config/gcn/gcn.c:2821
319 | }
| ^
0x5b8b27 rtvec_check_failed_bounds(rtvec_def const*, int, char const*, int,
char const*)
[...]/source-gcc/gcc/rtl.c:976
0x11af5d2 move_callee_saved_registers
[...]/source-gcc/gcc/config/gcn/gcn.c:2821
0x11afc2b gcn_expand_prologue()
[...]/source-gcc/gcc/config/gcn/gcn.c:2939
0x156b02a gen_prologue()
[...]/source-gcc/gcc/config/gcn/gcn.md:714
0x11a3e98 target_gen_prologue
./insn-target-def.h:433
0x9bded7 make_prologue_seq
[...]/source-gcc/gcc/function.c:5823
0x9be063 thread_prologue_and_epilogue_insns()
[...]/source-gcc/gcc/function.c:6041
0x9beac2 rest_of_handle_thread_prologue_and_epilogue
[...]/source-gcc/gcc/function.c:6532
0x9beac2 execute
[...]/source-gcc/gcc/function.c:6608
This appears with recent commit
r12-5436-gdc915b361bbc99da83fc53db7f7e0e28d0ce12c8 "Tweak tree-ssa-math-opts.c
to solve PR target/102117". It may well be a latent issue in the GCN target,
'-march=gfx900' specifically, instead of a problem with that commit
specifically?
(Locally reverting that commit does unblock the build.)