]> code.ossystems Code Review - openembedded-core.git/blob
ee423293cf2b38198d6d0a2e9310530634f485bb
[openembedded-core.git] /
1 Upstream-Status: Inappropriate [Backport]
2 From 2e8f32d39576b002280e29079ad6cfc55c852276 Mon Sep 17 00:00:00 2001
3 From: rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
4 Date: Tue, 26 Apr 2011 12:59:22 +0000
5 Subject: [PATCH 181/200] 2011-04-26  Richard Guenther  <rguenther@suse.de>
6
7         PR tree-optimization/48731
8         * ipa-inline.c (cgraph_flatten): Test if function is inlinable.
9
10         * gcc.dg/torture/pr48731.c: New testcase.
11
12
13 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172963 138bc75d-0d04-0410-961f-82ee72b054a4
14
15 index b3c9215..cbda4be 100644
16 --- a/gcc/ipa-inline.c
17 +++ b/gcc/ipa-inline.c
18 @@ -1337,6 +1337,9 @@ cgraph_flatten (struct cgraph_node *node)
19           continue;
20         }
21  
22 +      if (!e->callee->local.inlinable)
23 +       continue;
24 +
25        /* We've hit cycle?  It is time to give up.  */
26        if (e->callee->aux)
27         {
28 new file mode 100644
29 index 0000000..74b77f6
30 --- /dev/null
31 +++ b/gcc/testsuite/gcc.dg/torture/pr48731.c
32 @@ -0,0 +1,24 @@
33 +/* { dg-do compile } */
34 +
35 +#include <stdarg.h>
36 +
37 +int blah(int a, ...)
38 +{
39 +  va_list va;
40 +  va_start(va,a);
41 +  if (a == 0)
42 +    return -1;
43 +  else 
44 +    {
45 +      int i;
46 +      for (i = 0; i < a; i++)
47 +       va_arg(va,int);
48 +      return va_arg(va,int);
49 +    }
50 +}
51 +
52 +__attribute((flatten))
53 +int blah2(int b, int c)
54 +{
55 +  return blah(2, b, c);
56 +}
57 -- 
58 1.7.0.4
59