Commit d4e2d7d2 by Richard Sandiford Committed by Richard Sandiford

mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTSYM_OFFs.

gcc/
	* config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Handle
	UNSPEC_GOTSYM_OFFs.
	* config/mn10300/mn10300.c (legitimate_pic_operand_p): Return true
	for UNSPEC_GOTSYM_OFFs.
	* config/mn10300/mn10300.md (UNSPEC_GOTSYM_OFF): New unspec.
	(add_GOT_to_pic_reg): Use it.
	* config/mn10300/constraints.md (S): Allow UNSPEC_GOTSYM_OFF.

From-SVN: r141148
parent 3a63c9cd
2008-10-15 Richard Sandiford <rdsandiford@googlemail.com>
* config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Handle
UNSPEC_GOTSYM_OFFs.
* config/mn10300/mn10300.c (legitimate_pic_operand_p): Return true
for UNSPEC_GOTSYM_OFFs.
* config/mn10300/mn10300.md (UNSPEC_GOTSYM_OFF): New unspec.
(add_GOT_to_pic_reg): Use it.
* config/mn10300/constraints.md (S): Allow UNSPEC_GOTSYM_OFF.
2008-10-15 Jan Sjodin <jan.sjodin@amd.com>
Harsha Jagasia <harsha.jagasia@amd.com>
......
......@@ -68,7 +68,8 @@
(if_then_else (match_test "flag_pic")
(and (match_test "GET_CODE (op) == UNSPEC")
(ior (match_test "XINT (op, 1) == UNSPEC_PLT")
(match_test "XINT (op, 1) == UNSPEC_PIC")))
(match_test "XINT (op, 1) == UNSPEC_PIC")
(match_test "XINT (op, 1) == UNSPEC_GOTSYM_OFF")))
(match_test "GET_CODE (op) == SYMBOL_REF")))
;; Integer constraints
......
......@@ -1869,7 +1869,8 @@ legitimate_pic_operand_p (rtx x)
&& (XINT (x, 1) == UNSPEC_PIC
|| XINT (x, 1) == UNSPEC_GOT
|| XINT (x, 1) == UNSPEC_GOTOFF
|| XINT (x, 1) == UNSPEC_PLT))
|| XINT (x, 1) == UNSPEC_PLT
|| XINT (x, 1) == UNSPEC_GOTSYM_OFF))
return 1;
fmt = GET_RTX_FORMAT (GET_CODE (x));
......
......@@ -738,7 +738,7 @@ while (0)
constants. Used for PIC-specific UNSPECs. */
#define OUTPUT_ADDR_CONST_EXTRA(STREAM, X, FAIL) \
do \
if (GET_CODE (X) == UNSPEC && XVECLEN ((X), 0) == 1) \
if (GET_CODE (X) == UNSPEC) \
{ \
switch (XINT ((X), 1)) \
{ \
......@@ -762,6 +762,12 @@ while (0)
output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
fputs ("@PLT", (STREAM)); \
break; \
case UNSPEC_GOTSYM_OFF: \
assemble_name (STREAM, GOT_SYMBOL_NAME); \
fputs ("-(", STREAM); \
output_addr_const (STREAM, XVECEXP (X, 0, 0)); \
fputs ("-.)", STREAM); \
break; \
default: \
goto FAIL; \
} \
......
......@@ -45,6 +45,7 @@
(UNSPEC_GOT 2)
(UNSPEC_GOTOFF 3)
(UNSPEC_PLT 4)
(UNSPEC_GOTSYM_OFF 5)
])
(include "predicates.md")
......@@ -2619,18 +2620,9 @@
[(set (reg:SI PIC_REG)
(plus:SI
(reg:SI PIC_REG)
(const
(unspec [(minus:SI
(match_dup 1)
(const (minus:SI
(const (match_operand:SI 0 "" ""))
(pc))))
] UNSPEC_PIC))))]
""
"
{
operands[1] = gen_rtx_SYMBOL_REF (VOIDmode, GOT_SYMBOL_NAME);
}")
(const:SI
(unspec:SI [(match_operand:SI 0 "" "")] UNSPEC_GOTSYM_OFF))))]
"")
(define_expand "symGOT2reg"
[(match_operand:SI 0 "" "")
......
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