On Sun, Jan 14, 2018 at 10:52 AM, Uros Bizjak <ubiz...@gmail.com> wrote:
> On Sun, Jan 14, 2018 at 7:08 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
>> On Sun, Jan 14, 2018 at 9:51 AM, Uros Bizjak <ubiz...@gmail.com> wrote:
>>> -  (ior (and (not (match_test "TARGET_X32"))
>>> +  (ior (and (not (match_test "TARGET_X32
>>> +      || ix86_indirect_branch_thunk_register"))
>>>      (match_operand 0 "sibcall_memory_operand"))
>>> -       (and (match_test "TARGET_X32 && Pmode == DImode")
>>> +       (and (match_test "TARGET_X32 && Pmode == DImode
>>> + && !ix86_indirect_branch_thunk_register")
>>>      (match_operand 0 "GOT_memory_operand"))))
>>>
>>> Is this patch just trying to disable the predicate when
>>> ix86_indirect_branch_thunk_register is set? Because this is what this
>>> convoluted logic does.
>>
>> Yes, we want to disable all indirect branch via memory with
>> -mindirect-branch-register, just like -mx32.   We could do
>>
>> #idefine TARGET_INDIRECT_BRANCH_REGISTER \
>>  (TARGER_X32 ||  ix86_indirect_branch_thunk_register)
>
> Index: predicates.md
> ===================================================================
> --- predicates.md       (revision 256666)
> +++ predicates.md       (working copy)
> @@ -710,11 +710,10 @@
>    (ior (match_test "constant_call_address_operand
>                      (op, mode == VOIDmode ? mode : Pmode)")
>         (match_operand 0 "call_register_no_elim_operand")
> -       (ior (and (not (match_test "TARGET_X32
> -                                  || ix86_indirect_branch_thunk_register"))
> +       (and (not (match_test "ix86_indirect_branch_thunk_register"))
> +           (ior (and (not (match_test "TARGET_X32")))
>                  (match_operand 0 "memory_operand"))
> -           (and (match_test "TARGET_X32 && Pmode == DImode
> -                             && !ix86_indirect_branch_thunk_register")
> +                (and (match_test "TARGET_X32 && Pmode == DImode")
>                  (match_operand 0 "GOT_memory_operand")))))
>
> or something like that.
>

LGTM.

Thanks.

-- 
H.J.

Reply via email to