This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Avoid infinite recursion on flattening


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]