This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix IPA flattening ICE (PR ipa/82801)
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Jan Hubicka <jh at suse dot cz>, Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 18 Dec 2017 21:48:29 -0700
- Subject: Re: [PATCH] Fix IPA flattening ICE (PR ipa/82801)
- Authentication-results: sourceware.org; auth=none
- References: <20171212185758.GX2353@tucnak>
On 12/12/2017 11:57 AM, Jakub Jelinek wrote:
> Hi!
>
> We ICE on the following testcase, because we first gather all cgraph nodes
> in an array and then we walk it backwards and flatten_function anything
> that has "flatten" attribute. But flatten_function can result in cgraph
> node removal and so we then try to dereference removed cgraph nodes.
>
> From the array we are only interested in nodes with flatten attribute, so
> the patch ignores all other nodes (thus the common case of no flatten
> attributes in the TU is fast) by keeping them at the end of the order array
> only, and if we have at least 2 nodes to flatten, we additionally register
> a removal hook just in case a flatten node would be removed (the testcase
> has a non-flatten node removed only).
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2017-12-12 Jakub Jelinek <jakub@redhat.com>
>
> PR ipa/82801
> * ipa-inline.c (flatten_remove_node_hook): New function.
> (ipa_inline): Keep only nodes with flatten attribute at the end of
> the array in the order from ipa_reverse_postorder, only walk that
> portion of array for flattening, if there is more than one such
> node, temporarily register a removal hook and ignore removed nodes.
>
> * g++.dg/ipa/pr82801.C: New test.
OK. Make sure to reference 83346 in the ChangeLog entry.
jeff