This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Avoid infinite recursion on flattening
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Jan Hubicka" <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 21 Jan 2007 12:05:42 +0100
- Subject: Re: Avoid infinite recursion on flattening
- References: <20070121015134.GF19983@kam.mff.cuni.cz>
On 1/21/07, Jan Hubicka <jh@suse.cz> wrote:
Hi,
this patch avoid infinite recursion on flattening. I somehow assumed we
are safe with recursive_inlining_p but it tests only self recursion
(this has changed from early implementations of inliner)
This problem caused C++ benchmarks to fail today, I am testing the patch
and will commit it tomorrow if it passes to not disturb them once again.
Didn't I implement the cgraph_find_cycles thing to avoid exactly this
during cgraph_flatten_node? In the loop
+ /* Veify that we are not inlining function into itself to prevent
+ infinite loop. */
+ for (n = node; n->global.inlined_to ; n = node->callers->caller)
+ if (n->decl == e->callee->decl)
+ break;
'global' suggests that whenever this would happen in one part of the
cgraph you prevent inlining in another part that doesn't suffer from the
problem? If not, isn't fixing cgraph_recursive_inlining_p the better
fix (and marking the edge as non-inlinable to avoid re-computing it
again)?
Richard.