aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-04-08 11:14:06 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2003-04-08 09:14:06 +0000
commit799b33a028830934ff135f121d7048e2e6336e08 (patch)
tree53175dc42d76a682109261fa884fa26d3de4a2fa
parent3e71e0028f7a23cdc2ca07951abbb0ef1bda0689 (diff)
downloadgcc-799b33a028830934ff135f121d7048e2e6336e08.zip
gcc-799b33a028830934ff135f121d7048e2e6336e08.tar.gz
gcc-799b33a028830934ff135f121d7048e2e6336e08.tar.bz2
i386.c (legitimate_pic_address_disp_p): Do not accept PLUS in the GOTOFF operand.
* 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. From-SVN: r65367
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/i386/i386.c22
2 files changed, 28 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3d2e834..63bac4b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+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
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index fab8d95..b4c8faf 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -5674,6 +5674,13 @@ legitimate_constant_p (x)
&& 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))
@@ -5833,7 +5840,10 @@ legitimate_pic_address_disp_p (disp)
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:
@@ -6146,7 +6156,15 @@ legitimize_pic_address (orig, reg)
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);