Commit 8b015896 by Richard Henderson Committed by Richard Henderson

expr.c (force_operand): Detect PIC address loads before splitting arithmetic.

* expr.c (force_operand): Detect PIC address loads before
splitting arithmetic.

From-SVN: r20331
parent 8bc3afab
Mon Jun 8 09:22:38 PDT 1998 Jeff Law (law@cygnus.com) Mon Jun 8 10:43:15 1998 Richard Henderson <rth@cygnus.com>
* version.c: Bump for snapshot.
Mon Jun 8 09:17:09 PDT 1998 Jeff Law (law@cygnus.com) * expr.c (force_operand): Detect PIC address loads before
splitting arithmetic.
* version.c: Bump for snapshot. Mon Jun 8 09:22:38 PDT 1998 Jeff Law (law@cygnus.com)
Mon Jun 8 02:09:47 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot. * version.c: Bump for snapshot.
......
...@@ -4525,6 +4525,20 @@ force_operand (value, target) ...@@ -4525,6 +4525,20 @@ force_operand (value, target)
/* Use subtarget as the target for operand 0 of a binary operation. */ /* Use subtarget as the target for operand 0 of a binary operation. */
register rtx subtarget = (target != 0 && GET_CODE (target) == REG ? target : 0); register rtx subtarget = (target != 0 && GET_CODE (target) == REG ? target : 0);
/* Check for a PIC address load. */
if (flag_pic
&& (GET_CODE (value) == PLUS || GET_CODE (value) == MINUS)
&& XEXP (value, 0) == pic_offset_table_rtx
&& (GET_CODE (XEXP (value, 1)) == SYMBOL_REF
|| GET_CODE (XEXP (value, 1)) == LABEL_REF
|| GET_CODE (XEXP (value, 1)) == CONST))
{
if (!subtarget)
subtarget = gen_reg_rtx (GET_MODE (value));
emit_move_insn (subtarget, value);
return subtarget;
}
if (GET_CODE (value) == PLUS) if (GET_CODE (value) == PLUS)
binoptab = add_optab; binoptab = add_optab;
else if (GET_CODE (value) == MINUS) else if (GET_CODE (value) == MINUS)
......
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