https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117951
Bug ID: 117951 Summary: FAIL: 20_util/variant/run.cc -std=gnu++17 (test for excess errors) Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: danglin at gcc dot gnu.org Target Milestone: --- Created attachment 59815 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59815&action=edit Preprocessed source. spawn -ignore SIGHUP /home/dave/gnu/gcc/objdir/./gcc/xg++ -shared-libgcc -B/home /dave/gnu/gcc/objdir/./gcc -nostdinc++ -L/home/dave/gnu/gcc/objdir/hppa-linux-gn u/libstdc++-v3/src -L/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/src/. libs -L/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/libsupc++/.libs -B/ home/dave/opt/gnu/gcc/gcc-15/hppa-linux-gnu/bin/ -B/home/dave/opt/gnu/gcc/gcc-15 /hppa-linux-gnu/lib/ -isystem /home/dave/opt/gnu/gcc/gcc-15/hppa-linux-gnu/inclu de -isystem /home/dave/opt/gnu/gcc/gcc-15/hppa-linux-gnu/sys-include -fchecking= 1 -B/home/dave/gnu/gcc/objdir/hppa-linux-gnu/./libstdc++-v3/src/.libs -fmessage- length=0 -fno-show-column -ffunction-sections -fdata-sections -g -O2 -D_GNU_SOUR CE -DLOCALEDIR="." -nostdinc++ -I/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstd c++-v3/include/hppa-linux-gnu -I/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc ++-v3/include -I/home/dave/gnu/gcc/gcc/libstdc++-v3/libsupc++ -I/home/dave/gnu/g cc/gcc/libstdc++-v3/include/backward -I/home/dave/gnu/gcc/gcc/libstdc++-v3/tests uite/util /home/dave/gnu/gcc/gcc/libstdc++-v3/testsuite/20_util/variant/run.cc - std=gnu++17 -include bits/stdc++.h -fdiagnostics-plain-output ./libtestc++.a -Wl ,--gc-sections -L/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/src/files ystem/.libs -L/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/src/experime ntal/.libs -lm -o ./run.exe In file included from /home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/incl ude/vector:67, from /home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/incl ude/functional:66, from /home/dave/gnu/gcc/gcc/libstdc++-v3/include/precompiled/st dc++.h:55: /home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/include/bits/stl_uninitial ized.h: In destructor 'std::_UninitDestroyGuard<_ForwardIterator, _Alloc>::~_Uni nitDestroyGuard() [with _ForwardIterator = int*; _Alloc = __gnu_cxx::throw_alloc ator_limit<int>]': /home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/include/bits/stl_uninitial ized.h:95: error: unable to find a register to spill /home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/include/bits/stl_uninitial ized.h:95: error: this is the insn: (insn 95 950 96 6 (set (mem/f/c:SI (reg/f:SI 315) [152 MEM[(struct _Rb_tree_head er *)&_S_map + 4B]._M_header._M_right+0 S4 A32]) (reg/f:SI 316)) "/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/i nclude/bits/stl_tree.h":208:26 42 {*pa.md:2195} (expr_list:REG_DEAD (reg/f:SI 316) (expr_list:REG_DEAD (reg/f:SI 315) (nil)))) /home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/include/bits/stl_uninitial ized.h:95: confused by earlier errors, bailing out compiler exited with status 1 FAIL: 20_util/variant/run.cc -std=gnu++17 (test for excess errors) Excess errors: /home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/include/bits/stl_uninitialized.h:95: error: unable to find a register to spill /home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/include/bits/stl_uninitialized.h:95: error: this is the insn: (insn 95 950 96 6 (set (mem/f/c:SI (reg/f:SI 315) [152 MEM[(struct _Rb_tree_header *)&_S_map + 4B]._M_header._M_right+0 S4 A32]) (reg/f:SI 316)) "/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/include/bits/stl_tree.h":208:26 42 {*pa.md:2195} (expr_list:REG_DEAD (reg/f:SI 316) (expr_list:REG_DEAD (reg/f:SI 315) (nil)))) /home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/include/bits/stl_uninitialized.h:95: confused by earlier errors, bailing out Test compiles successfully at -O1. I think this is an RTL sharing issue. We have in ipa pass: (insn 85 44 92 4 (set (reg/f:SI 287) (plus:SI (reg/f:SI 280) (const_int 4 [0x4]))) "/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libs tdc++-v3/include/bits/stl_tree.h":207:25 120 {addsi3} (expr_list:REG_EQUIV (const:SI (plus:SI (symbol_ref/i:SI ("_ZZN9__gnu_cxx13 annotate_base13map_constructEvE6_S_map") [flags 0x202] <var_decl 0xf81d6898 _S_ map>) (const_int 4 [0x4]))) (nil))) [...] (insn 86 114 87 6 (set (mem/f/c:SI (plus:SI (reg/f:SI 280) (const_int 12 [0xc])) [152 MEM[(struct _Rb_tree_header *)&_S_map + 4B]._M_header._M_left+0 S4 A32]) (reg/f:SI 287)) "/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/include/bits/stl_tree.h":207:25 42 {*pa.md:2195} (nil)) (debug_insn 87 86 95 6 (debug_marker) "/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/include/bits/stl_tree.h":208:7 -1 (nil)) (insn 95 87 96 6 (set (mem/f/c:SI (reg/f:SI 288) [152 MEM[(struct _Rb_tree_header *)&_S_map + 4B]._M_header._M_right+0 S4 A32]) (reg/f:SI 287)) "/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/include/bits/stl_tree.h":208:26 42 {*pa.md:2195} (nil)) I suspect reload fails because there are two sets using reg/f:SI 287. Compile command is: /home/dave/gnu/gcc/objdir/./gcc/cc1plus -fpreprocessed ./run-run.ii -quiet -da -dumpdir ./run- -dumpbase run.cc -dumpbase-ext .cc -g -O2 -std=gnu++17 -version -fdiagnostics-color=never -fdiagnostics-urls=never -fchecking=1 -fmessage-length=0 -fno-show-column -ffunction-sections -fdata-sections -fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers -fdiagnostics-path-format=separate-events -fdiagnostics-text-art-charset=none -fno-diagnostics-show-event-links -o ./run-run.s -mlra