summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0181-2011-04-26-Richard-Guenther-rguenther-suse.de.patch
blob: 78202f0f84e60d489c86488aaf6556196fab6381 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 2e8f32d39576b002280e29079ad6cfc55c852276 Mon Sep 17 00:00:00 2001
From: rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 26 Apr 2011 12:59:22 +0000
Subject: [PATCH 181/200] 2011-04-26  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/48731
	* ipa-inline.c (cgraph_flatten): Test if function is inlinable.

	* gcc.dg/torture/pr48731.c: New testcase.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172963 138bc75d-0d04-0410-961f-82ee72b054a4

index b3c9215..cbda4be 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1337,6 +1337,9 @@ cgraph_flatten (struct cgraph_node *node)
 	  continue;
 	}
 
+      if (!e->callee->local.inlinable)
+	continue;
+
       /* We've hit cycle?  It is time to give up.  */
       if (e->callee->aux)
 	{
new file mode 100644
index 0000000..74b77f6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr48731.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+#include <stdarg.h>
+
+int blah(int a, ...)
+{
+  va_list va;
+  va_start(va,a);
+  if (a == 0)
+    return -1;
+  else 
+    {
+      int i;
+      for (i = 0; i < a; i++)
+	va_arg(va,int);
+      return va_arg(va,int);
+    }
+}
+
+__attribute((flatten))
+int blah2(int b, int c)
+{
+  return blah(2, b, c);
+}
-- 
1.7.0.4

OpenPOWER on IntegriCloud