From f791d3338777d809968269219240a037fba0a57c Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Fri, 5 Aug 2011 22:20:07 +0200 Subject: [PATCH] re PR tree-optimization/49735 (mips64-elf libgcc build fails with apparently infinite recursion.) PR middle-end/49735 * gcc.c-torture/compile/pr49735.c: New testcase * ipa-inline.c (recursive_inlining): Look through aliases. From-SVN: r177482 --- gcc/ChangeLog | 5 +++++ gcc/ipa-inline.c | 5 +++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/compile/pr49735.c | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr49735.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b9c089da34f..714a3c98724 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-08-05 Jan Hubicka + + PR middle-end/49735 + * ipa-inline.c (recursive_inlining): Look through aliases. + 2011-08-05 Jason Merrill * config/i386/i386.c (setup_incoming_varargs_ms_64): Move diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 366fc228780..c10a6182283 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1206,8 +1206,9 @@ recursive_inlining (struct cgraph_edge *edge, depth = 1; for (cnode = curr->caller; cnode->global.inlined_to; cnode = cnode->callers->caller) - if (node->decl == curr->callee->decl) - depth++; + if (node->decl + == cgraph_function_or_thunk_node (curr->callee, NULL)->decl) + depth++; if (!want_inline_self_recursive_call_p (curr, node, false, depth)) continue; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dfa765f7050..4739dbc9f95 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-08-05 Jan Hubicka + + PR middle-end/49735 + * gcc.c-torture/compile/pr49735.c: New testcase. + 2011-08-05 Jason Merrill PR c++/47453 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr49735.c b/gcc/testsuite/gcc.c-torture/compile/pr49735.c new file mode 100644 index 00000000000..ec5cbdcb48e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr49735.c @@ -0,0 +1,4 @@ +/* { dg-require-alias "" } */ +void bar (void); +static void foo (void) { bar (); } +void bar (void) __attribute__((alias("foo"))); -- 2.30.2