https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88723
Bug ID: 88723 Summary: [9 regression] PR debug/88635 patch breaks testsuite_shared.cc compilation Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: ro at gcc dot gnu.org CC: ebotcazou at gcc dot gnu.org, jakub at gcc dot gnu.org Target Milestone: --- Host: sparc-sun-solaris2.11 Target: sparc-sun-solaris2.11 Build: sparc-sun-solaris2.11 Between 20190104 (r267571) and 20190105 (r267602), libstdc++ testing got broken on Solaris/SPARC: +ERROR: could not compile testsuite_shared.cc +ERROR: tcl error sourcing /vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/libstdc++-abi/abi.exp. The log shows In file included from /var/gcc/regression/trunk/11.5-gcc/build/sparc-sun-solaris2.11/libstdc++-v3/include/sparc-sun-solaris2.11/bits/gthr.h:148, from /var/gcc/regression/trunk/11.5-gcc/build/sparc-sun-solaris2.11/libstdc++-v3/include/ext/atomicity.h:35, from /var/gcc/regression/trunk/11.5-gcc/build/sparc-sun-solaris2.11/libstdc++-v3/include/bits/basic_string.h:39, from /var/gcc/regression/trunk/11.5-gcc/build/sparc-sun-solaris2.11/libstdc++-v3/include/string:55, from /vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/util/testsuite_shared.cc:18: /var/gcc/regression/trunk/11.5-gcc/build/sparc-sun-solaris2.11/libstdc++-v3/include/sparc-sun-solaris2.11/bits/gthr-default.h: In function 'int __gthread_active_p()': /var/gcc/regression/trunk/11.5-gcc/build/sparc-sun-solaris2.11/libstdc++-v3/include/sparc-sun-solaris2.11/bits/gthr-default.h:181: note: non-delegitimized UNSPEC UNSPEC_MOVE_GOTDATA (14) found in variable location and many more, and all compiler output lets target_compile think there's an error, although the compilation succeeds otherwise. It turns out that reverting just the dwarf2out.c partof PR debug/88635 * dwarf2out.c (const_ok_for_output_1): Reject MINUS that contains SYMBOL_REF, CODE_LABEL or UNSPEC in subexpressions of second argument. Reject PLUS that contains SYMBOL_REF, CODE_LABEL or UNSPEC in subexpressions of both operands. (mem_loc_descriptor): Handle UNSPEC if target hook acks it and all the subrtxes are CONSTANT_P. Allows the compilation to succeed without error or messages.