This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI
- From: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Uros Bizjak <ubizjak at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 25 Sep 2014 01:51:10 +0400
- Subject: Re: [PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4a4JiD4Z8ygzvtODWaNtEz8pZbXYO+rBkWUL3MXv6ySOQ at mail dot gmail dot com> <20140919075558 dot GE50194 at msticlxl57 dot ims dot intel dot com> <CAFULd4ZSE3y=yf4Yf1+9qYbK5KzNs61qehyw-qokhLwAJm+=LA at mail dot gmail dot com> <542068E1 dot 5060504 at redhat dot com> <CAMbmDYZu9NpXsVn+DWQckcKhj6zR-Fh_EQ10FhdiQ03hqgxEgQ at mail dot gmail dot com> <5421B591 dot 6090705 at redhat dot com> <CAMbmDYahdc32CZvQzFGP33dQVFEALUTzRmBuMdyXSidPaUrrTg at mail dot gmail dot com> <CAMbmDYZX1+8F+YOODkPk_Pm7dfLaXRHLAvStem-unDwq+P7qCw at mail dot gmail dot com> <542316DC dot 5030700 at redhat dot com>
2014-09-24 23:09 GMT+04:00 Jeff Law <law@redhat.com>:
> On 09/24/14 07:13, Ilya Enkovich wrote:
>>
>> I tried to generate PARALLEL with all regs set by call. Here is a
>> memset call I got:
>>
>> (call_insn 23 22 24 2 (set (parallel [
>> (expr_list:REG_DEP_TRUE (reg:DI 0 ax)
>> (const_int 0 [0]))
>> (expr_list:REG_DEP_TRUE (reg:BND64 77 bnd0)
>> (const_int 0 [0]))
>> (expr_list:REG_DEP_TRUE (reg:BND64 78 bnd1)
>> (const_int 0 [0]))
>> ])
>> (call/j (mem:QI (symbol_ref:DI ("memset") [flags 0x41]
>
> [ snip ]
> Looks good. This is the approved way to handle multiple results of a call.
>
>>
>> During register allocation LRA generated a weird move instruction:
>>
>> (insn 63 0 0 (set (reg/f:DI 100)
>> (parallel [
>> (expr_list:REG_DEP_TRUE (reg:DI 0 ax)
>> (const_int 0 [0]))
>> (expr_list:REG_DEP_TRUE (reg:BND64 77 bnd0)
>> (const_int 0 [0]))
>> (expr_list:REG_DEP_TRUE (reg:BND64 78 bnd1)
>> (const_int 0 [0]))
>> ])) -1
>> (nil))
>>
>> Which caused ICE later in LRA. This move happens because of
>> REG_RETURNED (reg/f:DI 100) (see condition in inherit_in_ebb at
>> lra-constraints.c:5312). Thus this code in LRA doesn't accept
>> PARALLEL dest for calls.
>
> This is a bug in LRA then. Multiple return values aren't heavily used, so
> I'm not surprised that its handling was missed in LRA.
>
> The question now is how to bundle things together in such a way as to make
> it easy for Vlad to reproduce and fix this in LRA.
>
> Jeff
I suppose it should be easy to reproduce using the same test case I
use and some speudo patch which adds fake return values (e.g. xmm6 and
xmm7) to calls. Will try to make some minimal patch and test Vlad
could work with.
Ilya
- References:
- Re: [PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI
- Re: [PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI
- Re: [PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI
- Re: [PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI
- Re: [PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI
- Re: [PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI
- Re: [PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI
- Re: [PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI
- Re: [PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI