This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 23 Nov 2012 11:16:59 -0800
- Subject: Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address
- References: <CAFULd4autWYL1fJiVQeSZnM143uhR1uX6wOkaMkSTDvTcUb2tA@mail.gmail.com>
On Fri, Nov 23, 2012 at 10:59 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
>> This patch allocates extra 16 bytes for -fsanitize=address so that
>> asan won't report read beyond memory buffer. It is used by
>> bootstrap-asan. OK to install?
>
> /* Resize buffer if we allocated substantially too much, or if we
> - haven't enough space for the \n-terminator. */
> + haven't enough space for the \n-terminator. Allocate extra 16
> + bytes for -fsanitize=address. */
>
> I guess that extra _15_ bytes should be enough? The maximum we need
> for SSE stringops is additional 15 bytes, when only the first byte is
> allocated in the 16byte bundle.
>
If we need to clear the extra bytes, clearing 16 bytes can be faster
than 16 bytes.
--
H.J.