[Bug lto/97787] [10/11 regression] 64bit mips lto: .symtab local symbol at index x (>= sh_info of y)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97787 Richard Biener changed: What|Removed |Added Ever confirmed|0 |1 Assignee|unassigned at gcc dot gnu.org |hubicka at gcc dot gnu.org Last reconfirmed|2020-11-11 00:00:00 |2021-04-09 Status|UNCONFIRMED |ASSIGNED --- Comment #27 from Richard Biener --- Honza, please have a look at this PR.
[Bug lto/97787] [10/11 regression] 64bit mips lto: .symtab local symbol at index x (>= sh_info of y)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97787 Richard Biener changed: What|Removed |Added Target Milestone|10.3|10.4 --- Comment #26 from Richard Biener --- GCC 10.3 is being released, retargeting bugs to GCC 10.4.
[Bug lto/97787] [10/11 regression] 64bit mips lto: .symtab local symbol at index x (>= sh_info of y)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97787 --- Comment #25 from Richard Biener --- OK, so it's read as *.LTHUNK5.lto_priv.0/2880 (*.LTHUNK5) @0xfff1163840 Type: function definition analyzed alias Visibility: in_other_partition used_from_other_partition prevailing_def_ironly external public visibility_specified visibility:hidden artificial References: _ZN4Sass10Parameters20adjust_after_pushingENS_10SharedImplINS_9ParameterEEE/2879 (alias) Referring: Read from file: libsass.so.1.0.0.ltrans16.o Unit id: 3 Function flags: Called by: _ZThn64_N4Sass10Parameters20adjust_after_pushingENS_10SharedImplINS_9ParameterEEE/349153 (can throw external) _ZThn64_N4Sass10Parameters20adjust_after_pushingENS_10SharedImplINS_9ParameterEEE/2881 (can throw external) Calls: and thus indeed "external" (in_other_partition). Defined in ltrans1.s as .globl .LTHUNK5.lto_priv.0 .hidden .LTHUNK5.lto_priv.0 .LTHUNK5.lto_priv.0 = _ZN4Sass10Parameters20adjust_after_pushingENS_10SharedImplINS_9ParameterEEE which I think means that possibly the process of bringing a symbol local needs to mangle the assembler name before using it more thoroughly or the mips target in particular needs to introduce the extern symbol to the assembler to not confuse it with a local label. I think the latter is more likely - Honza should know if other targets (like AIX ...) are affected similarly and what we have to do here. Honza?
[Bug lto/97787] [10/11 regression] 64bit mips lto: .symtab local symbol at index x (>= sh_info of y)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97787 --- Comment #24 from Xi Ruoyao --- (In reply to Richard Biener from comment #22) > There is target specific sanitizing of symbol names - if the name is really > the issue then it should be _much_ more prevalent since all IPA cloning uses > dots as well. clone_function_name produces them and ASM_FORMAT_PRIVATE_NAME > is the "sanitizer" that's supposed to mangle it to correct form. But as the > name suggests the definition of a local private symbol isn't supposed to go > away without all of its uses so the real issue must be elsewhere in > optimization. > (thus asking for IPA dumps, specifically the .000i.cgraph dump which should > mention when the compiler thinks the .LTHUNK5.lto_priv.0 goes away) IPA dumps (along with .ltrans* files) are uploaded: https://bf.mengyan1223.wang/assets/gcc-97787/libsass_lto_ipa_dump.tar.xz
[Bug lto/97787] [10/11 regression] 64bit mips lto: .symtab local symbol at index x (>= sh_info of y)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97787 Andrew Pinski changed: What|Removed |Added Component|target |lto CC||pinskia at gcc dot gnu.org --- Comment #23 from Andrew Pinski --- (In reply to Richard Biener from comment #20) > Indeed already the name, .LTHUNK5.lto_priv.0, hints at that this should be a > local symbol. Not sure why we end up with a .reloc then. > > ld $25,%got_disp(.LTHUNK5.lto_priv.0)($28) > .LEHB26 = . > .reloc 1f,R_MIPS_JALR,.LTHUNK5.lto_priv.0 > 1: jalr$25 > > this seems to be in _ZN4Sass6Parser16parse_parametersEv So 64bit MIPS n64 ABI with -mxgot does all function calls via loading an address from the GOT, the .reloc there is to say to the linker to see if it can relax it to be a direct jump (with link) rather than the indirect jump. Looking into the cp/method.c code, I see we are creating an alias called .LTHUNK5 for a function which seems to be fine. So either we are not outputing the correct name or the way local aliases are not being handled correctly when splitting up the LTO partitions; -flto-partition=none is a hint there.
[Bug lto/97787] [10/11 regression] 64bit mips lto: .symtab local symbol at index x (>= sh_info of y)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97787 --- Comment #5 from Adrian Bunk --- (In reply to Richard Biener from comment #4) > You can also try to 'reduce' the testcase. Since you are linking a shared > object you can try to strip as many linker inputs as possible and then > reduce the source files. Bisecting does not work when both halves are working, but I now found some clues: $ g++ -flto -shared CMakeFiles/cpp.dir/src/dolfin.cpp.o CMakeFiles/cpp.dir/src/parameter.cpp.o CMakeFiles/cpp.dir/src/adaptivity.cpp.o CMakeFiles/cpp.dir/src/ale.cpp.o CMakeFiles/cpp.dir/src/common.cpp.o CMakeFiles/cpp.dir/src/fem.cpp.o CMakeFiles/cpp.dir/src/function.cpp.o CMakeFiles/cpp.dir/src/generation.cpp.o CMakeFiles/cpp.dir/src/geometry.cpp.o CMakeFiles/cpp.dir/src/graph.cpp.o CMakeFiles/cpp.dir/src/log.cpp.o CMakeFiles/cpp.dir/src/math.cpp.o CMakeFiles/cpp.dir/src/mesh.cpp.o CMakeFiles/cpp.dir/src/multistage.cpp.o CMakeFiles/cpp.dir/src/ts.cpp.o CMakeFiles/cpp.dir/src/io.cpp.o CMakeFiles/cpp.dir/src/la.cpp.o CMakeFiles/cpp.dir/src/nls.cpp.o CMakeFiles/cpp.dir/src/refinement.cpp.o CMakeFiles/cpp.dir/src/MPICommWrapper.cpp.o /usr/bin/ld: /tmp/ccofV1SZ.ltrans32.ltrans.o: .symtab local symbol at index 214 (>= sh_info of 34) /usr/bin/ld: /tmp/ccofV1SZ.ltrans32.ltrans.o: error adding symbols: bad value collect2: error: ld returned 1 exit status $ g++ -flto -shared dolfin.ii parameter.ii adaptivity.ii ale.ii common.ii fem.ii function.ii generation.ii geometry.ii graph.ii log.ii math.ii mesh.ii multistage.ii ts.ii io.ii la.ii nls.ii refinement.ii MPICommWrapper.ii /tmp/ccraiNyo.ltrans9.ltrans.o: in function `std::__exception_ptr::exception_ptr::operator=(std::__exception_ptr::exception_ptr&&)': :(.text+0x290): relocation truncated to fit: R_MIPS_CALL16 against `std::__exception_ptr::exception_ptr::~exception_ptr()@@CXXABI_1.3.3' /tmp/ccraiNyo.ltrans9.ltrans.o: in function `std::__cxx11::to_string(int)': :(.text+0x414): relocation truncated to fit: R_MIPS_CALL16 against `std::__cxx11::basic_string, std::allocator >::basic_string(unsigned long, char, std::allocator const&)@@GLIBCXX_3.4.21' :(.text+0x42c): relocation truncated to fit: R_MIPS_CALL16 against `std::allocator::~allocator()@@GLIBCXX_3.4' :(.text+0x498): relocation truncated to fit: R_MIPS_CALL16 against `std::allocator::~allocator()@@GLIBCXX_3.4' :(.text+0x4b0): relocation truncated to fit: R_MIPS_CALL16 against `_Unwind_Resume@@GCC_3.0' :(.text+0x4e0): relocation truncated to fit: R_MIPS_CALL16 against `_Unwind_Resume@@GCC_3.0' /tmp/ccraiNyo.ltrans9.ltrans.o: in function `std::__cxx11::to_string(unsigned long)': :(.text+0x584): relocation truncated to fit: R_MIPS_CALL16 against `std::__cxx11::basic_string, std::allocator >::basic_string(unsigned long, char, std::allocator const&)@@GLIBCXX_3.4.21' :(.text+0x598): relocation truncated to fit: R_MIPS_CALL16 against `std::allocator::~allocator()@@GLIBCXX_3.4' :(.text+0x5c8): relocation truncated to fit: R_MIPS_CALL16 against `std::__cxx11::basic_string, std::allocator >::size() const@@GLIBCXX_3.4.21' :(.text+0x610): relocation truncated to fit: R_MIPS_CALL16 against `std::allocator::~allocator()@@GLIBCXX_3.4' :(.text+0x628): additional relocation overflows omitted from the output collect2: error: ld returned 1 exit status $ g++ -flto -shared dolfin.ii parameter.ii adaptivity.ii ale.ii common.ii fem.ii function.ii generation.ii geometry.ii graph.ii log.ii math.ii mesh.ii multistage.ii ts.ii io.ii la.ii nls.ii refinement.ii MPICommWrapper.ii -mxgot $ g++ -flto -shared CMakeFiles/cpp.dir/src/dolfin.cpp.o CMakeFiles/cpp.dir/src/parameter.cpp.o CMakeFiles/cpp.dir/src/adaptivity.cpp.o CMakeFiles/cpp.dir/src/ale.cpp.o CMakeFiles/cpp.dir/src/common.cpp.o CMakeFiles/cpp.dir/src/fem.cpp.o CMakeFiles/cpp.dir/src/function.cpp.o CMakeFiles/cpp.dir/src/generation.cpp.o CMakeFiles/cpp.dir/src/geometry.cpp.o CMakeFiles/cpp.dir/src/graph.cpp.o CMakeFiles/cpp.dir/src/log.cpp.o CMakeFiles/cpp.dir/src/math.cpp.o CMakeFiles/cpp.dir/src/mesh.cpp.o CMakeFiles/cpp.dir/src/multistage.cpp.o CMakeFiles/cpp.dir/src/ts.cpp.o CMakeFiles/cpp.dir/src/io.cpp.o CMakeFiles/cpp.dir/src/la.cpp.o CMakeFiles/cpp.dir/src/nls.cpp.o CMakeFiles/cpp.dir/src/refinement.cpp.o CMakeFiles/cpp.dir/src/MPICommWrapper.cpp.o -flto-partition=none $ Adding -mxgot to compiler and linker flags of a normal LTO build does not work, but -flto-partition=none during linking is a workaround.
[Bug lto/97787] [10/11 regression] 64bit mips lto: .symtab local symbol at index x (>= sh_info of y)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97787 --- Comment #4 from Richard Biener --- Hmm, the final linker input, namely /tmp/bibletime.kNyaLB.ltrans9.ltrans.o would be a start. Adding -save-temps should eventually retain it (but likely somewhere else with a different name). You can also try to 'reduce' the testcase. Since you are linking a shared object you can try to strip as many linker inputs as possible and then reduce the source files. creduce or multi-delta or cvise might help you here. Eventually Martin can help but I don't think the compile-farm has a mips64 machine.
[Bug lto/97787] [10/11 regression] 64bit mips lto: .symtab local symbol at index x (>= sh_info of y)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97787 Adrian Bunk changed: What|Removed |Added CC||bunk at stusta dot de --- Comment #3 from Adrian Bunk --- (In reply to Richard Biener from comment #1) > I guess it succeeds when you do not enable -g? Still fails with -g0 (In reply to Richard Biener from comment #1) > Can you check if reverting > 63a2bdbfb42628800a6999e98804928855592ce7 or > 136256c32db63600168516e562441f73c26a187a helps? That said, is 10.1.0 OK? (In reply to Martin Liška from comment #2) > I bet 136256c32db63600168516e562441f73c26a187a should fix that. Sorry for omitting more exact version information in the bug report. Known-broken are all Debian gcc-10 packages since gcc 10 became default in Debian unstable, upstream this is the gcc-10 branch from 20200808 to 20201029. This implies that the two mentioned commits did not break or fix it. Is there any debug information I could gather that might be useful for you?
[Bug lto/97787] [10/11 regression] 64bit mips lto: .symtab local symbol at index x (>= sh_info of y)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97787 --- Comment #2 from Martin Liška --- (In reply to Richard Biener from comment #1) > I guess it succeeds when you do not enable -g? Can you check if reverting > 63a2bdbfb42628800a6999e98804928855592ce7 or > 136256c32db63600168516e562441f73c26a187a helps? That said, is 10.1.0 OK? I bet 136256c32db63600168516e562441f73c26a187a should fix that.
[Bug lto/97787] [10/11 regression] 64bit mips lto: .symtab local symbol at index x (>= sh_info of y)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97787 Richard Biener changed: What|Removed |Added Keywords||lto Target||mips64 Target Milestone|--- |10.3 Status|UNCONFIRMED |WAITING CC||rguenth at gcc dot gnu.org Last reconfirmed||2020-11-11 Ever confirmed|0 |1 --- Comment #1 from Richard Biener --- I guess it succeeds when you do not enable -g? Can you check if reverting 63a2bdbfb42628800a6999e98804928855592ce7 or 136256c32db63600168516e562441f73c26a187a helps? That said, is 10.1.0 OK?