This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR68337] Don't fold memcpy/memmove we want to instrument
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>,Ilya Enkovich <enkovich dot gnu at gmail dot com>,gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 Nov 2015 18:19:39 +0100
- Subject: Re: [PATCH, PR68337] Don't fold memcpy/memmove we want to instrument
- Authentication-results: sourceware.org; auth=none
- References: <20151119163110 dot GG42296 at msticlxl57 dot ims dot intel dot com> <564E02FE dot 5020503 at redhat dot com>
On November 19, 2015 6:12:30 PM GMT+01:00, Bernd Schmidt <bschmidt@redhat.com> wrote:
>On 11/19/2015 05:31 PM, Ilya Enkovich wrote:
>> Currently we fold all memcpy/memmove calls with a known data size.
>> It causes two problems when used with Pointer Bounds Checker.
>> The first problem is that we may copy pointers as integer data
>> and thus loose bounds. The second problem is that if we inline
>> memcpy, we also have to inline bounds copy and this may result
>> in a huge amount of code and significant compilation time growth.
>> This patch disables folding for functions we want to instrument.
>>
>> Does it look reasonable for trunk and GCC5 branch? Bootstrapped
>> and regtested on x86_64-unknown-linux-gnu.
>
>Can't see anything wrong with it. Ok.
But for small sizes this can have a huge impact on optimization. Which is why we have the code in the first place. I'd make the check less broad, for example inlining copies of size less than a pointer shouldn't be affected.
Richard.
>
>Bernd