This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add valgrind support to alloc-pool.c


On Sat, Aug 18, 2012 at 9:56 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Sat, Aug 18, 2012 at 6:17 AM, Andrew Pinski <pinskia@gmail.com> wrote:
>> Hi,
>>   I implemented this patch almost 6 years ago when the df branch was
>> being worked on.  It adds valgrind support to  alloc-pool.c to catch
>> cases of using memory after free the memory.
>>
>> OK?  Bootstrapped and tested on x86_64-linux-gnu with no regressions.
>
> Ok.

It doesn't work.  Did you check with valgrind checking?

/space/rguenther/tramp3d/trunk/gcc/alloc-pool.c: In function 'void*
pool_alloc(alloc_pool)':
/space/rguenther/tramp3d/trunk/gcc/alloc-pool.c:250:3: error: expected
primary-expression before 'int'
/space/rguenther/tramp3d/trunk/gcc/alloc-pool.c:250:3: error: expected
')' before 'int'
/space/rguenther/tramp3d/trunk/gcc/alloc-pool.c:250:3: error: expected
')' before ';' token
/space/rguenther/tramp3d/trunk/gcc/alloc-pool.c:263:3: error: 'size'
was not declared in this scope
/space/rguenther/tramp3d/trunk/gcc/alloc-pool.c:303:7: error: 'size'
was not declared in this scope

that's because VALGRIND_DISCARD is not what you think it is.

Testing a fix ...

Richard.

> Thanks,
> Richard.
>
>> Thanks,
>> Andrew Pinski
>>
>> ChangeLog:
>> * alloc-pool.c (pool_alloc): Add valgrind markers.
>> (pool_free): Likewise.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]