Commit 44201dba by Jeffrey A Law Committed by Jeff Law

pa.c (emit_move_sequence): Handle a function label source operand.

        * pa.c (emit_move_sequence): Handle a function label source
        operand.

From-SVN: r17174
parent e2de3a46
Sun Dec 21 21:54:22 1997 Jeffrey A Law (law@cygnus.com)
* pa.c (emit_move_sequence): Handle a function label source
operand.
Sun Dec 21 16:13:55 1997 Nick Clifton <nickc@cygnus.com Sun Dec 21 16:13:55 1997 Nick Clifton <nickc@cygnus.com
* c-pragma.c (handle_pragma_token): Generate warning messages * c-pragma.c (handle_pragma_token): Generate warning messages
......
...@@ -1244,8 +1244,12 @@ emit_move_sequence (operands, mode, scratch_reg) ...@@ -1244,8 +1244,12 @@ emit_move_sequence (operands, mode, scratch_reg)
} }
} }
/* Simplify the source if we need to. */ /* Simplify the source if we need to.
Note we do have to handle function labels here, even though we do
not consider them legitimate constants. Loop optimizations can
call the emit_move_xxx with one a function as a source. */
if ((GET_CODE (operand1) != HIGH && immediate_operand (operand1, mode)) if ((GET_CODE (operand1) != HIGH && immediate_operand (operand1, mode))
|| function_label_operand (operand1, mode)
|| (GET_CODE (operand1) == HIGH || (GET_CODE (operand1) == HIGH
&& symbolic_operand (XEXP (operand1, 0), mode))) && symbolic_operand (XEXP (operand1, 0), mode)))
{ {
...@@ -1263,9 +1267,10 @@ emit_move_sequence (operands, mode, scratch_reg) ...@@ -1263,9 +1267,10 @@ emit_move_sequence (operands, mode, scratch_reg)
So we force the plabel into memory, load operand0 from So we force the plabel into memory, load operand0 from
the memory location, then add in the constant part. */ the memory location, then add in the constant part. */
if (GET_CODE (operand1) == CONST if ((GET_CODE (operand1) == CONST
&& GET_CODE (XEXP (operand1, 0)) == PLUS && GET_CODE (XEXP (operand1, 0)) == PLUS
&& function_label_operand (XEXP (XEXP (operand1, 0), 0), Pmode)) && function_label_operand (XEXP (XEXP (operand1, 0), 0), Pmode))
|| function_label_operand (operand1, mode))
{ {
rtx temp, const_part; rtx temp, const_part;
...@@ -1275,13 +1280,25 @@ emit_move_sequence (operands, mode, scratch_reg) ...@@ -1275,13 +1280,25 @@ emit_move_sequence (operands, mode, scratch_reg)
else if (flag_pic) else if (flag_pic)
scratch_reg = gen_reg_rtx (Pmode); scratch_reg = gen_reg_rtx (Pmode);
/* Save away the constant part of the expression. */ if (GET_CODE (operand1) == CONST)
const_part = XEXP (XEXP (operand1, 0), 1); {
if (GET_CODE (const_part) != CONST_INT) /* Save away the constant part of the expression. */
abort (); const_part = XEXP (XEXP (operand1, 0), 1);
if (GET_CODE (const_part) != CONST_INT)
abort ();
/* Force the function label into memory. */
temp = force_const_mem (mode, XEXP (XEXP (operand1, 0), 0));
}
else
{
/* No constant part. */
const_part = NULL_RTX;
/* Force the function label into memory. */ /* Force the function label into memory. */
temp = force_const_mem (mode, XEXP (XEXP (operand1, 0), 0)); temp = force_const_mem (mode, operand1);
}
/* Get the address of the memory location. PIC-ify it if /* Get the address of the memory location. PIC-ify it if
necessary. */ necessary. */
...@@ -1300,7 +1317,8 @@ emit_move_sequence (operands, mode, scratch_reg) ...@@ -1300,7 +1317,8 @@ emit_move_sequence (operands, mode, scratch_reg)
emit_move_sequence (operands, mode, scratch_reg); emit_move_sequence (operands, mode, scratch_reg);
/* And add back in the constant part. */ /* And add back in the constant part. */
expand_inc (operand0, const_part); if (const_part != NULL_RTX)
expand_inc (operand0, const_part);
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment