Commit c399861d by Michael Meissner

Supprt LABEL_REFs when using -fpic.

From-SVN: r8222
parent 8ad4abfc
...@@ -1572,7 +1572,8 @@ legitimize_pic_address (orig, reg) ...@@ -1572,7 +1572,8 @@ legitimize_pic_address (orig, reg)
if (reg == 0) if (reg == 0)
reg = gen_reg_rtx (Pmode); reg = gen_reg_rtx (Pmode);
if (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_FLAG (addr)) if ((GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_FLAG (addr))
|| GET_CODE (addr) == LABEL_REF)
new = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig); new = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
else else
new = gen_rtx (MEM, Pmode, new = gen_rtx (MEM, Pmode,
...@@ -1854,7 +1855,9 @@ output_pic_addr_const (file, x, code) ...@@ -1854,7 +1855,9 @@ output_pic_addr_const (file, x, code)
fprintf (file, "@GOTOFF(%%ebx)"); fprintf (file, "@GOTOFF(%%ebx)");
else if (code == 'P') else if (code == 'P')
fprintf (file, "@PLT"); fprintf (file, "@PLT");
else if (GET_CODE (x) == LABEL_REF || ! SYMBOL_REF_FLAG (x)) else if (GET_CODE (x) == LABEL_REF)
fprintf (file, "@GOTOFF");
else if (! SYMBOL_REF_FLAG (x))
fprintf (file, "@GOT"); fprintf (file, "@GOT");
else else
fprintf (file, "@GOTOFF"); fprintf (file, "@GOTOFF");
...@@ -2176,15 +2179,14 @@ print_operand_address (file, addr) ...@@ -2176,15 +2179,14 @@ print_operand_address (file, addr)
if (addr != 0) if (addr != 0)
{ {
if (GET_CODE (addr) == LABEL_REF) if (flag_pic)
output_pic_addr_const (file, addr, 0);
else if (GET_CODE (addr) == LABEL_REF)
output_asm_label (addr); output_asm_label (addr);
else else
{ output_addr_const (file, addr);
if (flag_pic)
output_pic_addr_const (file, addr, 0);
else
output_addr_const (file, addr);
}
} }
if (ireg != 0 && GET_CODE (ireg) == MULT) if (ireg != 0 && GET_CODE (ireg) == MULT)
......
...@@ -808,9 +808,7 @@ ...@@ -808,9 +808,7 @@
/* Fastest way to change a 0 to a 1. */ /* Fastest way to change a 0 to a 1. */
return AS1 (inc%L0,%0); return AS1 (inc%L0,%0);
if (flag_pic if (flag_pic && SYMBOLIC_CONST (operands[1]))
&& GET_CODE (operands[1]) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (operands[1]))
return AS2 (lea%L0,%a1,%0); return AS2 (lea%L0,%a1,%0);
return AS2 (mov%L0,%1,%0); return AS2 (mov%L0,%1,%0);
...@@ -2538,7 +2536,7 @@ ...@@ -2538,7 +2536,7 @@
;; addsi3 is faster, so put this after. ;; addsi3 is faster, so put this after.
(define_insn "" (define_insn "movsi_lea"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(match_operand:QI 1 "address_operand" "p"))] (match_operand:QI 1 "address_operand" "p"))]
"" ""
......
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