On Tue, Jul 26, 2011 at 10:33 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
> On Tue, Jul 26, 2011 at 1:29 PM, Jakub Jelinek <ja...@redhat.com> wrote:
>> On Tue, Jul 26, 2011 at 10:21:11PM +0200, Uros Bizjak wrote:
>>> This also works, we look at orig_x that looks like:
>>>
>>> (mem/u/c:SI (const:DI (unspec:DI [
>>>                 (symbol_ref:SI ("__sflush") [flags 0x41]
>>> <function_decl 0x7f6f2eaad000 __sflush>)
>>>             ] UNSPEC_GOTPCREL)) [2 S4 A8])
>>>
>>> So, we look at SImode load, and compare it with SImode (actually
>>> ptr_mode) symbol. Will your suggestion work with this RTX?
>>
>> Then
>>      if (GET_MODE (orig_x) != GET_MODE (x))
>>        {
>>          x = simplify_gen_subreg (GET_MODE (orig_x), x, GET_MODE (x), 0);
>>          if (x == NULL_RTX)
>>            return orig_x;
>>        }
>> will work, orig_x is the above SImode MEM, x is (symbol_ref:SI ("__sflush")
>> [flags 0x41] <function_decl 0x7f6f2eaad000 __sflush>)
>> thus the modes are the same and no simplify_gen_subreg needs to be done, the
>> mode is already right.
>>
>
> This works for my testcase. I will do a full test.

Also OK for mainline, wih suitable ChangeLog and bootstrap/regression test.

BTW: I'm thinking of removing this check from ix86_expand_move:

@@ -15034,7 +15034,6 @@ ix86_expand_move (enum machine_mode mode
     }

   if ((flag_pic || MACHOPIC_INDIRECT)
-      && (mode == SImode || mode == DImode)
       && symbolic_operand (op1, mode))
     {
       if (TARGET_MACHO && !TARGET_64BIT)

There is no way symbolic_operand would be in different mode than SImode/DImode.

Uros.

Reply via email to