On Mon, Mar 12, 2012 at 12:39 PM, Uros Bizjak <ubiz...@gmail.com> wrote:
> On Sun, Mar 11, 2012 at 10:24 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
>
>> Here is the patch which is equivalent to clearing MASK_TLS_DIRECT_SEG_REFS
>> when Pmode != word_mode.  We need to keep
>>
>>          else if (Pmode == SImode)
>>            {
>>              /* Always generate
>>                        movl %fs:0, %reg32
>>                        addl xgottpoff(%rip), %reg32
>>                 to support linker IE->LE optimization and avoid
>>                 fs:(%reg32) as memory operand.  */
>>              dest = gen_reg_rtx (Pmode);
>>              emit_insn (gen_tls_initial_exec_x32 (dest, x));
>>              return dest;
>>            }
>>
>> to support linker IE->LE optimization.  TARGET_TLS_DIRECT_SEG_REFS only 
>> affects
>> TLS LE access and fs:(%reg) is only generated by combine.
>>
>> So the main impact of disabling TARGET_TLS_DIRECT_SEG_REFS is to disable
>> fs:immediate memory operand for TLS LE access, which doesn't have any 
>> problems
>> to begin with.
>>
>> I would prefer to keep TARGET_TLS_DIRECT_SEG_REFS and disable only
>> fs:(%reg), which is generated by combine.
>
> Please try attached patch.  It introduces TARGET_TLS_INDIRECT_SEG_REFS
> to block only indirect seg references.
>
> Uros.

I am testing it.

-- 
H.J.

Reply via email to