This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 04/N] Fix big memory leak in ix86_valid_target_attribute_p
- From: Martin LiÅka <mliska at suse dot cz>
- To: Ramana Radhakrishnan <ramana dot radhakrishnan at foss dot arm dot com>, Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Thu, 12 Nov 2015 17:24:28 +0100
- Subject: Re: [PATCH 04/N] Fix big memory leak in ix86_valid_target_attribute_p
- Authentication-results: sourceware.org; auth=none
- References: <564081EF dot 7030003 at suse dot cz> <564463F4 dot 7080003 at suse dot cz> <CAFiYyc0vtRAwE2PX581th3aHbfuFSqycsw-Ra_60=3mFVii=hg at mail dot gmail dot com> <5644B5B0 dot 6040703 at suse dot cz> <5644B73F dot 8020108 at foss dot arm dot com>
On 11/12/2015 04:58 PM, Ramana Radhakrishnan wrote:
>
>
> On 12/11/15 15:52, Martin LiÅka wrote:
>> On 11/12/2015 12:29 PM, Richard Biener wrote:
>>> On Thu, Nov 12, 2015 at 11:03 AM, Martin LiÅka <mliska@suse.cz> wrote:
>>>> Hello.
>>>>
>>>> Following patch was a bit negotiated with Jakub and can save a huge amount of memory in cases
>>>> where target attributes are heavily utilized.
>>>>
>>>> Can bootstrap and survives regression tests on x86_64-linux-pc.
>>>>
>>>> Ready for trunk?
>>>
>>> +static bool opts_obstack_initialized = false;
>>> +
>>> +/* Initialize opts_obstack if not initialized. */
>>> +
>>> +void
>>> +init_opts_obstack (void)
>>> +{
>>> + if (!opts_obstack_initialized)
>>> + {
>>> + opts_obstack_initialized = true;
>>> + gcc_obstack_init (&opts_obstack);
>>>
>>> you can move the static global to function scope.
>>>
>>> Ok with that change.
>>
>> Done and installed as r230264. Final version of the patch is attached.
>>
>>>
>>> Btw, don't other targets need a similar adjustment to their hook?
>>> Grepping shows arm and nios2.
>>
>> nios2 is not the case as it doesn't utilize:
>> init_options_struct (&func_options, NULL);
>>
>> I've been testing patch for aarch64 that is also included in the email.
>
> The change is also needed in config/aarch64/aarch64.c (aarch64_option_valid_attribute_p). The attached patch is for arm i.e. 32 bit arm.
>
> Ramana
You are right that the change is for arm32, I wrongly wrote aarch64. However if you read
aarch64_option_valid_attribute_p, there is no init_options_struct (&func_options, NULL).
So that, I'm going to test on an arm32 machine.
Martin
>
>>
>> Martin
>>
>>>
>>> Thanks,
>>> Richard.
>>>
>>>
>>>> Thanks,
>>>> Martin
>>