+Tue Apr 8 11:12:07 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (legitimate_pic_address_disp_p): Do not accept PLUS in the
+ GOTOFF operand.
+ (legitimize_pic_address): Move plus outside the unspec.
+ * i386.c (legitimate_constant_p): Check (CONST (PLUS (UNSPEC ...
+ for validity.
+
2003-04-08 Nathan Sidwell <nathan@codesourcery.com>
* gcov-io.h (gcov_save_position): Remove __inline__ from
&& tls_symbolic_operand (XEXP (inner, 0), Pmode))
return false;
+ if (GET_CODE (inner) == PLUS)
+ {
+ if (GET_CODE (XEXP (inner, 1)) != CONST_INT)
+ return false;
+ inner = XEXP (inner, 0);
+ }
+
/* Only some unspecs are valid as "constants". */
if (GET_CODE (inner) == UNSPEC)
switch (XINT (inner, 1))
return false;
return GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF;
case UNSPEC_GOTOFF:
- return local_symbolic_operand (XVECEXP (disp, 0, 0), Pmode);
+ if (GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF
+ || GET_CODE (XVECEXP (disp, 0, 0)) == LABEL_REF)
+ return local_symbolic_operand (XVECEXP (disp, 0, 0), Pmode);
+ return false;
case UNSPEC_GOTTPOFF:
case UNSPEC_GOTNTPOFF:
case UNSPEC_INDNTPOFF:
if (reload_in_progress)
regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTOFF);
+ if (GET_CODE (addr) == CONST)
+ addr = XEXP (addr, 0);
+ if (GET_CODE (addr) == PLUS)
+ {
+ new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, XEXP (addr, 0)), UNSPEC_GOTOFF);
+ new = gen_rtx_PLUS (Pmode, new, XEXP (addr, 1));
+ }
+ else
+ new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTOFF);
new = gen_rtx_CONST (Pmode, new);
new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);