diff mbox

[rs6000] Fix reload failures in 64-bit mode with no special constant pool

Message ID 4833987.MWR9OqUvYI@polaris
State New
Headers show

Commit Message

Eric Botcazou Nov. 7, 2016, 9:44 a.m. UTC
> Now you don't need to have a special pool to call create_TOC_reference, you
> can call it for regular TOC references as well, as done a few lines above:
> 
>       /* If this is a SYMBOL_REF that refers to a constant pool entry,
> 	 and we have put it in the TOC, we just need to make a TOC-relative
> 	 reference to it.  */
>       if (TARGET_TOC
> 	  && GET_CODE (operands[1]) == SYMBOL_REF
> 	  && use_toc_relative_ref (operands[1], mode))
> 	operands[1] = create_TOC_reference (operands[1], operands[0]);
> 
> So the attached patch does it there too.
> 
> Tested on PowerPC64/Linux (LRA) and VxWorks (reload), OK for the mainline?

Revised version attached, with Pmode formally changed to mode (but mode == 
Pmode here so no functional change whatsoever).

Tested on PowerPC64/Linux, OK for the mainline?


       * config/rs6000/rs6000.c (rs6000_emit_move): Also use a TOC reference
        after forcing to constant memory when the code model is medium.

Comments

Segher Boessenkool Jan. 17, 2017, 12:25 p.m. UTC | #1
Hi Eric,

On Mon, Nov 07, 2016 at 10:44:44AM +0100, Eric Botcazou wrote:
> Tested on PowerPC64/Linux, OK for the mainline?
> 
> 
>        * config/rs6000/rs6000.c (rs6000_emit_move): Also use a TOC reference
>         after forcing to constant memory when the code model is medium.

Sorry I lost track of this patch again.

After a lot of staring it does seem okay.  Approved for trunk.  Please
watch out for fallout though.

Thanks,


Segher


> --- config/rs6000/rs6000.c	(revision 241856)
> +++ config/rs6000/rs6000.c	(working copy)
> @@ -10673,10 +10673,7 @@ rs6000_emit_move (rtx dest, rtx source,
>  
>  	  if (TARGET_TOC
>  	      && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
> -	      && constant_pool_expr_p (XEXP (operands[1], 0))
> -	      && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (
> -			get_pool_constant (XEXP (operands[1], 0)),
> -			get_pool_mode (XEXP (operands[1], 0))))
> +	      && use_toc_relative_ref (XEXP (operands[1], 0), mode))
>  	    {
>  	      rtx tocref = create_TOC_reference (XEXP (operands[1], 0),
>  						 operands[0]);
diff mbox

Patch

Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c	(revision 241856)
+++ config/rs6000/rs6000.c	(working copy)
@@ -10673,10 +10673,7 @@  rs6000_emit_move (rtx dest, rtx source,
 
 	  if (TARGET_TOC
 	      && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
-	      && constant_pool_expr_p (XEXP (operands[1], 0))
-	      && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (
-			get_pool_constant (XEXP (operands[1], 0)),
-			get_pool_mode (XEXP (operands[1], 0))))
+	      && use_toc_relative_ref (XEXP (operands[1], 0), mode))
 	    {
 	      rtx tocref = create_TOC_reference (XEXP (operands[1], 0),
 						 operands[0]);