This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, i386]: Remove pic_symbolic_operand predicate


Hello!

The sole purpose of pic_symbolic_operand is to prevent PIC operands in case of:

  /* Current assemblers are broken and do not allow @GOTOFF in
     ought but a memory context.  */

As shown in [1], even gas from binutils-2.13.1 happily assembles

addl x@GOTOFF(%ebx), %eax

in 32bit mode, as well as

addq x@GOTPCREL(%rip), %rax

in 64bit mode.

I have receive off-list confirmation from Mike Stump that:

<quote>
>> addl L_x$non_lazy_ptr-L00000000001$pb(%ecx), %eax
>>
>> Ultimately, I would like to remove checks involving
>> pic_symbolic_operands, but removing them on 64bit would be OK, too.

That appears to be fine on darwin.  I didn't spot anything that would
cause problems with it.
</quote>

Since Windows targets don't use these relocs, I visually checked that
generated results for a couple of test cases were the same.

So, the patch removes this artificial limitation.

2010-06-04  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/predicates.md (pic_symbolic_operand): Remove predicate.
	* config/i386/i386.md (*add<mode>_1): Do not use pic_symbolic_operand
	predicate in "type" attribute calculation.
	(*addsi_1_zext): Ditto.
	(*add<mode>_2): Do not use pic_symbolic_operand in insn predicate.
	(*addsi_2_zext): Ditto.
	(*add<mode>_3): Ditto.
	(*addsi_3_zext): Ditto.
	(*add<mode>_5): Ditto.

Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu
{,-m32}. Committed to mainline.

[1] http://gcc.gnu.org/ml/gcc/2010-06/msg00189.html

Uros.

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]