https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92095
--- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- Author: ebotcazou Date: Fri Nov 8 12:38:03 2019 New Revision: 277968 URL: https://gcc.gnu.org/viewcvs?rev=277968&root=gcc&view=rev Log: PR target/92095 * config/sparc/sparc-protos.h (output_load_pcrel_sym): Declare. * config/sparc/sparc.c (sparc_cannot_force_const_mem): Revert latest change. (got_helper_needed): New static variable. (output_load_pcrel_sym): New function. (get_pc_thunk_name): Remove after inlining... (load_got_register): ...here. Rework the initialization of the GOT register and of the GOT helper. (save_local_or_in_reg_p): Test the REGNO of the GOT register. (sparc_file_end): Test got_helper_needed to decide whether the GOT helper must be emitted. Use output_asm_insn instead of fprintf. (sparc_init_pic_reg): In PIC mode, always initialize the PIC register if optimization is enabled. * config/sparc/sparc.md (load_pcrel_sym<P:mode>): Emit the assembly by calling output_load_pcrel_sym. Added: branches/gcc-8-branch/gcc/testsuite/gcc.c-torture/compile/20191108-1.c - copied unchanged from r277967, trunk/gcc/testsuite/gcc.c-torture/compile/20191108-1.c Modified: branches/gcc-8-branch/gcc/ChangeLog branches/gcc-8-branch/gcc/config/sparc/sparc-protos.h branches/gcc-8-branch/gcc/config/sparc/sparc.c branches/gcc-8-branch/gcc/config/sparc/sparc.md branches/gcc-8-branch/gcc/testsuite/ChangeLog branches/gcc-8-branch/gcc/testsuite/gcc.target/sparc/overflow-3.c branches/gcc-8-branch/gcc/testsuite/gcc.target/sparc/overflow-4.c branches/gcc-8-branch/gcc/testsuite/gcc.target/sparc/overflow-5.c