From: Michael Meissner Date: Tue, 9 Jul 2019 17:30:34 +0000 (+0000) Subject: rs6000-internal.h (create_TOC_reference): Delete. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=18c0ed4b46990c504525aa4928aab45907c8256d;p=gcc.git rs6000-internal.h (create_TOC_reference): Delete. 2019-07-09 Michael Meissner * config/rs6000/rs6000-internal.h (create_TOC_reference): Delete. * config/rs6000/rs6000-logue.c (create_TOC_reference): Move function from rs6000-logue.c back to rs6000.c. * config/rs6000/rs6000.c (create_TOC_reference): Likewise. From-SVN: r273309 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1606b910391..dc34222f4d9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-07-09 Michael Meissner + + * config/rs6000/rs6000-internal.h (create_TOC_reference): Delete. + * config/rs6000/rs6000-logue.c (create_TOC_reference): Move + function from rs6000-logue.c back to rs6000.c. + * config/rs6000/rs6000.c (create_TOC_reference): Likewise. + 2019-07-09 Martin Sebor PR c++/61339 diff --git a/gcc/config/rs6000/rs6000-internal.h b/gcc/config/rs6000/rs6000-internal.h index f69fa5d3013..c526967a3f7 100644 --- a/gcc/config/rs6000/rs6000-internal.h +++ b/gcc/config/rs6000/rs6000-internal.h @@ -92,7 +92,6 @@ extern void rs6000_emit_prologue_components (sbitmap components); extern void rs6000_emit_epilogue_components (sbitmap components); extern void rs6000_set_handled_components (sbitmap components); extern rs6000_stack_t * rs6000_stack_info (void); -extern rtx create_TOC_reference (rtx symbol, rtx largetoc_reg); extern rtx rs6000_got_sym (void); extern struct machine_function *rs6000_init_machine_status (void); extern bool save_reg_p (int reg); diff --git a/gcc/config/rs6000/rs6000-logue.c b/gcc/config/rs6000/rs6000-logue.c index 8454f96fcc3..acc11df0f2d 100644 --- a/gcc/config/rs6000/rs6000-logue.c +++ b/gcc/config/rs6000/rs6000-logue.c @@ -1406,41 +1406,6 @@ uses_TOC (void) } #endif -rtx -create_TOC_reference (rtx symbol, rtx largetoc_reg) -{ - rtx tocrel, tocreg, hi; - - if (TARGET_DEBUG_ADDR) - { - if (SYMBOL_REF_P (symbol)) - fprintf (stderr, "\ncreate_TOC_reference, (symbol_ref %s)\n", - XSTR (symbol, 0)); - else - { - fprintf (stderr, "\ncreate_TOC_reference, code %s:\n", - GET_RTX_NAME (GET_CODE (symbol))); - debug_rtx (symbol); - } - } - - if (!can_create_pseudo_p ()) - df_set_regs_ever_live (TOC_REGISTER, true); - - tocreg = gen_rtx_REG (Pmode, TOC_REGISTER); - tocrel = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, symbol, tocreg), UNSPEC_TOCREL); - if (TARGET_CMODEL == CMODEL_SMALL || can_create_pseudo_p ()) - return tocrel; - - hi = gen_rtx_HIGH (Pmode, copy_rtx (tocrel)); - if (largetoc_reg != NULL) - { - emit_move_insn (largetoc_reg, hi); - hi = largetoc_reg; - } - return gen_rtx_LO_SUM (Pmode, hi, tocrel); -} - /* Issue assembly directives that create a reference to the given DWARF FRAME_TABLE_LABEL from the current function section. */ void diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index bec3436ffc5..ccc9d764382 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -7735,6 +7735,45 @@ constant_pool_expr_p (rtx op) && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (base), Pmode)); } +/* Create a TOC reference for symbol_ref SYMBOL. If LARGETOC_REG is non-null, + use that as the register to put the HIGH value into if register allocation + is already done. */ + +rtx +create_TOC_reference (rtx symbol, rtx largetoc_reg) +{ + rtx tocrel, tocreg, hi; + + if (TARGET_DEBUG_ADDR) + { + if (SYMBOL_REF_P (symbol)) + fprintf (stderr, "\ncreate_TOC_reference, (symbol_ref %s)\n", + XSTR (symbol, 0)); + else + { + fprintf (stderr, "\ncreate_TOC_reference, code %s:\n", + GET_RTX_NAME (GET_CODE (symbol))); + debug_rtx (symbol); + } + } + + if (!can_create_pseudo_p ()) + df_set_regs_ever_live (TOC_REGISTER, true); + + tocreg = gen_rtx_REG (Pmode, TOC_REGISTER); + tocrel = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, symbol, tocreg), UNSPEC_TOCREL); + if (TARGET_CMODEL == CMODEL_SMALL || can_create_pseudo_p ()) + return tocrel; + + hi = gen_rtx_HIGH (Pmode, copy_rtx (tocrel)); + if (largetoc_reg != NULL) + { + emit_move_insn (largetoc_reg, hi); + hi = largetoc_reg; + } + return gen_rtx_LO_SUM (Pmode, hi, tocrel); +} + /* These are only used to pass through from print_operand/print_operand_address to rs6000_output_addr_const_extra over the intervening function output_addr_const which is not target code. */