From: Richard Henderson Date: Tue, 6 Jul 2004 22:40:16 +0000 (-0700) Subject: i386.c (legitimize_pic_address): Make static. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b39edae36eba74d4e0bdf5049544bb5f86dbe8bd;p=gcc.git i386.c (legitimize_pic_address): Make static. * config/i386/i386.c (legitimize_pic_address): Make static. (legitimize_address): Handle CONST with TLS operand. (ix86_expand_move): Don't call legitimize_pic_address directly. * config/i386/i386-protos.h (legitimize_pic_address): Remove. From-SVN: r84173 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eb2dc4e67d0..5ae46ce891f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-07-06 Richard Henderson + + * config/i386/i386.c (legitimize_pic_address): Make static. + (legitimize_address): Handle CONST with TLS operand. + (ix86_expand_move): Don't call legitimize_pic_address directly. + * config/i386/i386-protos.h (legitimize_pic_address): Remove. + 2004-07-06 Roger Sayle * ifcvt.c (struct noce_if_info): Add a Boolean b_unconditional field. diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 42771f95051..66e1e136f27 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -104,7 +104,6 @@ extern bool constant_address_p (rtx); extern bool legitimate_pic_operand_p (rtx); extern int legitimate_pic_address_disp_p (rtx); extern int legitimate_address_p (enum machine_mode, rtx, int); -extern rtx legitimize_pic_address (rtx, rtx); extern rtx legitimize_address (rtx, rtx, enum machine_mode); extern void print_reg (rtx, int, FILE*); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 4b1e389641b..1ce078d90a6 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6291,7 +6291,7 @@ ix86_GOT_alias_set (void) GO_IF_LEGITIMATE_ADDRESS rejects symbolic references unless the PIC reg also appears in the address. */ -rtx +static rtx legitimize_pic_address (rtx orig, rtx reg) { rtx addr = orig; @@ -6621,6 +6621,13 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) log = tls_symbolic_operand (x, mode); if (log) return legitimize_tls_address (x, log, false); + if (GET_CODE (x) == CONST + && GET_CODE (XEXP (x, 0)) == PLUS + && (log = tls_symbolic_operand (XEXP (XEXP (x, 0), 0), Pmode))) + { + rtx t = legitimize_tls_address (XEXP (XEXP (x, 0), 0), log, false); + return gen_rtx_PLUS (Pmode, t, XEXP (XEXP (x, 0), 1)); + } if (flag_pic && SYMBOLIC_CONST (x)) return legitimize_pic_address (x, 0); @@ -8414,15 +8421,7 @@ ix86_expand_move (enum machine_mode mode, rtx operands[]) if (GET_CODE (op0) == MEM) op1 = force_reg (Pmode, op1); else - { - rtx temp = op0; - if (GET_CODE (temp) != REG) - temp = gen_reg_rtx (Pmode); - temp = legitimize_pic_address (op1, temp); - if (temp == op0) - return; - op1 = temp; - } + op1 = legitimize_address (op1, op1, Pmode); #endif /* TARGET_MACHO */ } else