Thumb PIC

Nick Clifton nickc@cygnus.com
Mon Jul 26 09:24:00 GMT 1999


Hi Phil,

: Fri Jul 23 15:17:59 1999  Philip Blundell  <pb@nexus.co.uk>
: 
: 	* config/arm/thumb.h (THUMB_FLAG_SINGLE_PIC_BASE): Define.
: 	(TARGET_SINGLE_PIC_BASE): Likewise.
: 	(GOT_PCREL, NEED_GOT_RELOC, NEED_PLT_RELOC): Provide default
: 	definitions.
: 	(TARGET_CALLEE_INTERWORKING): Fix typo in comment.
: 	(TARGET_SWITCHES): Add -m{no-}single-pic-base.
: 	(TARGET_OPTIONS): Add -mpic-register=N.
: 	(OUTPUT_INT_ADDR_CONST): New macro.
: 	(INDEX_REGISTER_RTX_P, PIC_OFFSET_TABLE_REGNUM, FINALIZE_PIC,
: 	LEGITIMATE_PIC_OPERAND_P): Likewise.
: 	(LEGITIMIZE_ADDRESS, GOT_IF_LEGITIMATE_ADDRESS): Support PIC.
: 	(ASM_OUTPUT_INT): Use OUTPUT_INT_ADDR_CONST rather than calling
: 	output_addr_const directly.
: 	(PRINT_OPERAND_PUNCT_VALID_P): Accept `|' for compatibility with 
: 	ARM port.
: 	(thumb_pic_register, thumb_pic_register_string): Declare.
: 	* config/arm/thumb.md (movsi): Support PIC.
: 	(call_insn): Change "i" constraint to "X".
: 	(call_value_insn): Likewise.
: 	(consttable_4, consttable_8, consttable_end): Set and clear
: 	"making_const_table" as appropriate.
: 	(pic_load_addr, pic_add_dot_plus_four): New insns.
: 	
: 	* invoke.texi (Thumb Options): Fix spelling.  Document new 
: 	options -msingle-pic-base and -mpic-register=.

This patch looks OK, apart from one small point:

: +(define_insn "pic_add_dot_plus_four"
: +  [(set (match_operand 0 "register_operand" "+r")
: +	(plus:SI (match_dup 0) (const (plus:SI (pc) (const_int 8)))))
: +   (use (label_ref (match_operand 1 "" "")))]

Shouldn' this be:

: +(define_insn "pic_add_dot_plus_four"
: +  [(set (match_operand 0 "register_operand" "+r")
: +	(plus:SI (match_dup 0) (const (plus:SI (pc) (const_int 4)))))
: +   (use (label_ref (match_operand 1 "" "")))]               ^
                                                               |
                                                               |
                                                          change here

With that assumption applied, I have checked in your patch.

Cheers
	Nick


More information about the Gcc-patches mailing list