PR middle-end/49735
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Aug 2011 20:20:07 +0000 (20:20 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Aug 2011 20:20:07 +0000 (20:20 +0000)
        * gcc.c-torture/compile/pr49735.c: New testcase
        * ipa-inline.c (recursive_inlining): Look through aliases.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177482 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ipa-inline.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr49735.c [new file with mode: 0644]

index b9c089d..714a3c9 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 366fc22..c10a618 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 dfa765f..4739dbc 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")));