This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Clean up dangling pointers in cgraph_edge (PR ipa/89330).
- From: Martin Liška <mliska at suse dot cz>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Andreas Schwab <schwab at suse dot de>
- Date: Tue, 30 Jul 2019 10:48:49 +0200
- Subject: Re: [PATCH] Clean up dangling pointers in cgraph_edge (PR ipa/89330).
- References: <e238458c-64c5-3a56-237a-18823085aced@suse.cz> <CAFiYyc0yxm=L3wpuMfbBOBRPnJBYMJRr6Ng7zdu4-roXC1fONA@mail.gmail.com>
On 7/30/19 10:36 AM, Richard Biener wrote:
> On Tue, Jul 30, 2019 at 9:27 AM Martin Liška <mliska@suse.cz> wrote:
>>
>> Hi.
>>
>> We have to clean up dangling pointers before we call ggc_free for a cgraph_edge.
>>
>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>> And it survives --enable-checking=release bootstrap on x86_64-linux-gnu.
>>
>> Ready to be installed?
>
> Eh? The only "real" effect I see is that e->indirect_info test is now
> never true.
Yep, you are right.
>
> I think it rather means the edge we ggc_free is still referenced to
> from somewhere
> and _that_ needs to be fixed or we ggc_free the edge wrongly.
Yes, that's one another situation IPA CP is touching a dead cgraph_edge.
Martin will help me latter.
I'm reducing a test-case now..
Martin
>
> Richard.
>
>> Thanks,
>> Martin
>>
>> gcc/ChangeLog:
>>
>> 2019-07-30 Martin Liska <mliska@suse.cz>
>>
>> PR ipa/89330
>> * cgraph.c (symbol_table::free_edge): Memset 0 to cgraph_edge
>> before we call ggc_free.
>> ---
>> gcc/cgraph.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>>