This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA][PATCH] Adding missing calls to bitmap_clear
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Bernd Schmidt <bschmidt at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 22 Mar 2016 10:37:30 +0100
- Subject: Re: [RFA][PATCH] Adding missing calls to bitmap_clear
- Authentication-results: sourceware.org; auth=none
- References: <56F0461C dot 3070601 at redhat dot com> <56F0470F dot 6080804 at redhat dot com> <56F05A74 dot 2080200 at redhat dot com>
On Mon, Mar 21, 2016 at 9:32 PM, Jeff Law <law@redhat.com> wrote:
> On 03/21/2016 01:10 PM, Bernd Schmidt wrote:
>>
>> On 03/21/2016 08:06 PM, Jeff Law wrote:
>>>
>>>
>>> As noted last week, find_removable_extensions initializes several
>>> bitmaps, but doesn't clear them.
>>>
>>> This is not strictly a leak as the GC system should find dead data, but
>>> it's better to go ahead and clear the bitmaps. That releases the
>>> elements back to the cache and presumably makes things easier for the GC
>>> system as well.
>>>
>>> Bootstrapped and regression tested on x86_64-linux-gnu.
>>>
>>> OK for the trunk?
>>
>>
>> Looks like they don't leak anywhere, so ok. Probably ok even to install
>> it now but maybe stage1 would be better timing.
>
> I don't mind waiting for the next stage1, this is a pretty minor issue.
It's ok at this stage as it will also fix -fmem-report. Please also move
the thing back to heap, see below.
Btw we should disallow bitmap_initialize (&x, NULL) as it does not do
the same thing as BITMAP_ALLOC (NULL), it does the same thing
as BITMAP_ALLOC_GC (). Thus I'd rather have a bitmap_initialize_gc (&x)
and a bitmap_initialize (&x, NULL) that ends up using the global
bitmap obstack. No idea where REE came from history wise.
A grep shows only
ira.c: bitmap_initialize (&seen_insns, NULL);
ree.c: bitmap_initialize (&init, NULL);
ree.c: bitmap_initialize (&kill, NULL);
ree.c: bitmap_initialize (&gen, NULL);
ree.c: bitmap_initialize (&tmp, NULL);
btw, so please consider simply changing bitmap_initialize behavior. The IRA
use also should use the global bitmap obstack as users around that use
use BITMAP_ALLOC (NULL). [use a default arg for 'obstack' if possible,
you have to verify it works with/without --enable-gather-detailed-mem-stats]
Thanks,
Richard.
> jeff