* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141148
138bc75d-0d04-0410-961f-
82ee72b054a4
+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>
(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
&& (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));
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)) \
{ \
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; \
} \
(UNSPEC_GOT 2)
(UNSPEC_GOTOFF 3)
(UNSPEC_PLT 4)
+ (UNSPEC_GOTSYM_OFF 5)
])
(include "predicates.md")
[(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 "" "")