re PR tree-optimization/49735 (mips64-elf libgcc build fails with apparently infinite...
authorJan Hubicka <jh@suse.cz>
Fri, 5 Aug 2011 20:20:07 +0000 (22:20 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 5 Aug 2011 20:20:07 +0000 (20:20 +0000)
        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
gcc/ipa-inline.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr49735.c [new file with mode: 0644]

index b9c089da34f3273884a0c5c18477330a33835ab3..714a3c987241a7b00d0b62259e40c8fca205a7e3 100644 (file)
@@ -1,3 +1,8 @@
+2011-08-05  Jan Hubicka  <jh@suse.cz>
+
+       PR middle-end/49735
+       * ipa-inline.c (recursive_inlining): Look through aliases.
+
 2011-08-05  Jason Merrill  <jason@redhat.com>
 
        * config/i386/i386.c (setup_incoming_varargs_ms_64): Move
index 366fc2287806c06888b3cab8e2b6755f656dd5e3..c10a61822837c00d45fce13afe68f5a73094e1e5 100644 (file)
@@ -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;
index dfa765f7050c172319d81af75cbb555cd1c39e85..4739dbc9f952f564934f9d5b9536ecf48b0be46f 100644 (file)
@@ -1,3 +1,8 @@
+2011-08-05  Jan Hubicka  <jh@suse.cz>
+
+       PR middle-end/49735
+       * gcc.c-torture/compile/pr49735.c: New testcase.
+
 2011-08-05  Jason Merrill  <jason@redhat.com>
 
        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 (file)
index 0000000..ec5cbdc
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-require-alias "" } */
+void bar (void);
+static void foo (void) { bar (); }
+void bar (void) __attribute__((alias("foo")));