[asan] a small patch to fix bogus error about global buffer overflow

2012-10-25 Thread Wei Mi
Hi, A small patch to remove the bogus error reports exposed in the spec2000 testing. In varasm.c, asan_protected should be equivalent with asan_protect_global (decl) all the time, or else compiler will not insert redzones for some globals planned to be protected. gcc/ChangeLog: 2012-10-25 Wei

Re: [asan] a small patch to fix bogus error about global buffer overflow

2012-10-25 Thread Xinliang David Li
Should the alignment check be moved into 'asan_protect_global' method? David On Thu, Oct 25, 2012 at 2:32 PM, Wei Mi w...@google.com wrote: Hi, A small patch to remove the bogus error reports exposed in the spec2000 testing. In varasm.c, asan_protected should be equivalent with

Re: [asan] a small patch to fix bogus error about global buffer overflow

2012-10-25 Thread Diego Novillo
On Thu, Oct 25, 2012 at 5:32 PM, Wei Mi w...@google.com wrote: Hi, A small patch to remove the bogus error reports exposed in the spec2000 testing. In varasm.c, asan_protected should be equivalent with asan_protect_global (decl) all the time, or else compiler will not insert redzones for

Re: [asan] a small patch to fix bogus error about global buffer overflow

2012-10-25 Thread Jakub Jelinek
On Thu, Oct 25, 2012 at 02:32:33PM -0700, Wei Mi wrote: A small patch to remove the bogus error reports exposed in the spec2000 testing. In varasm.c, asan_protected should be equivalent with asan_protect_global (decl) all the time, or else compiler will not insert redzones for some globals

Re: [asan] a small patch to fix bogus error about global buffer overflow

2012-10-25 Thread Jakub Jelinek
On Thu, Oct 25, 2012 at 05:46:47PM -0400, Diego Novillo wrote: The change looks fine to me, but why not just move the alignment check into asan_protect_global? I'll defer to David or Jakub in this. asan_protect_global has || DECL_ALIGN_UNIT (decl) 2 * ASAN_RED_ZONE_SIZE check among other

Re: [asan] a small patch to fix bogus error about global buffer overflow

2012-10-25 Thread Xinliang David Li
Why not relaxing the check even more to allow for instance 128 byte alignment which may be common? David On Thu, Oct 25, 2012 at 2:51 PM, Jakub Jelinek ja...@redhat.com wrote: On Thu, Oct 25, 2012 at 05:46:47PM -0400, Diego Novillo wrote: The change looks fine to me, but why not just move the

Re: [asan] a small patch to fix bogus error about global buffer overflow

2012-10-25 Thread Wei Mi
Hi, Thanks for all the comments. Fixed. Ok to checkin? 2012-10-25 Wei Mi  w...@google.com * varasm.c (assemble_variable): Set asan_protected even for decls that are already ASAN_RED_ZONE_SIZE or more bytes aligned. Index: varasm.c

Re: [asan] a small patch to fix bogus error about global buffer overflow

2012-10-25 Thread Jakub Jelinek
On Thu, Oct 25, 2012 at 03:48:07PM -0700, Wei Mi wrote: Thanks for all the comments. Fixed. Ok to checkin? 2012-10-25 Wei Mi  w...@google.com * varasm.c (assemble_variable): Set asan_protected even for decls that are already ASAN_RED_ZONE_SIZE or more bytes