https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78325
Bug ID: 78325 Summary: [7 regression] r235825 causes gcc.target/mips/call-5.c, gcc.target/mips/call-6.c R_MIPS_JALR failures Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: ma...@linux-mips.org Target Milestone: --- Target: mips-linux-gnu PR rtl-optimization/70890 fix (r235825) causes REG_EQUIV notes to be removed from PIC call register loads in the MIPS new ABIs for function calls to local symbols which use GOT_PAGE/GOT_OFST relocations. These notes are used in `mips_pic_call_symbol_from_set' to determine the actual symbol referred in call insns and use it to produce a suitable R_MIPS_JALR relocation. Consequently the relocations are not output anymore causing these regression test failures: FAIL: gcc.target/mips/call-5.c -O2 scan-assembler \\.reloc\t1f,R_MIPS_JALR,staticfunc\n1:\tjalrc?\t FAIL: gcc.target/mips/call-5.c -O3 -g scan-assembler \\.reloc\t1f,R_MIPS_JALR,staticfunc\n1:\tjalrc?\t FAIL: gcc.target/mips/call-5.c -O2 -flto -fno-use-linker-plugin -flto-partition=none scan-assembler \\.reloc\t1f,R_MIPS_JALR,staticfunc\n1:\tjalrc?\t FAIL: gcc.target/mips/call-5.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects scan-assembler \\.reloc\t1f,R_MIPS_JALR,staticfunc\n1:\tjalrc?\t FAIL: gcc.target/mips/call-6.c -O2 scan-assembler \\.reloc\t1f,R_MIPS_JALR,staticfunc\n1:\tjalrc?\t FAIL: gcc.target/mips/call-6.c -O3 -g scan-assembler \\.reloc\t1f,R_MIPS_JALR,staticfunc\n1:\tjalrc?\t FAIL: gcc.target/mips/call-6.c -O2 -flto -fno-use-linker-plugin -flto-partition=none scan-assembler \\.reloc\t1f,R_MIPS_JALR,staticfunc\n1:\tjalrc?\t FAIL: gcc.target/mips/call-6.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects scan-assembler \\.reloc\t1f,R_MIPS_JALR,staticfunc\n1:\tjalrc?\t and the linker cannot perform the branch optimisation intended, which is especially relevant for function calls to local symbols. With r235825 reverted on top of current trunk these regressions are gone.