This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [CHKP] Support returned bounds in thunks expand
- From: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 3 Apr 2015 11:38:35 +0300
- Subject: Re: [CHKP] Support returned bounds in thunks expand
- Authentication-results: sourceware.org; auth=none
- References: <20150306141531 dot GA27860 at msticlxl57 dot ims dot intel dot com> <CAMbmDYa1kQoWtn=SJNZ7rNidnu7g8RE5Pcwh_oMMV16tT3fFSg at mail dot gmail dot com> <551D9BA6 dot 8080908 at redhat dot com>
2015-04-02 22:42 GMT+03:00 Jeff Law <law@redhat.com>:
> On 04/02/2015 08:49 AM, Ilya Enkovich wrote:
>>
>> Ping
>>
>> 2015-03-10 13:12 GMT+03:00 Ilya Enkovich <enkovich.gnu@gmail.com>:
>>>
>>> Hi,
>>>
>>> Currentl we loose returned bounds when functions are merged. This patch
>>> fixes it by adding returne bounds support for cgraph_node::expand_thunk.
>>> Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk?
>>>
>>> Thanks,
>>> Ilya
>>> --
>>> gcc/
>>>
>>> 2015-03-06 Ilya Enkovich <ilya.enkovich@intel.com>
>>>
>>> * cgraphunit.c (cgraph_node::expand_thunk): Build returned
>>> bounds for instrumented functions.
>>>
>>> gcc/testsuite/
>>>
>>> 2015-03-06 Ilya Enkovich <ilya.enkovich@intel.com>
>>>
>>> * gcc/testsuite/gcc.target/i386/thunk-retbnd.c: New.
>
> I really dislike the amount of gimple and bounded pointer knowledge in this
> code.
>
> It seems like a significant modularity violation and while you didn't
> introduce the gimple stuff, we probably shouldn't be making it worse.
>
> Is it possible to let this code build up the thunk, then pass it off as a
> whole to the chkp code to add the instrumentation, particularly for the
> return value?
OK, will rework the patch.
>
> ALso, is this critical for stage4? It looks like this is strictly a QofI
> change, correct?
Actually having just a tail call in a function we don't lose bounds
and I don't expect it affects QofI. But we get instrumented function
with no returned bounds for a pointer which triggers an assert
somewhere (don't remember exact place). I'll revisit the original
problem and will probably make a simpler stability fix for now,
leaving thunk modification for stage 1.
Thanks,
Ilya
>
> jeff
>