OSDN Git Service

* decl.c (start_preparsed_function): Set
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 30 Aug 2007 16:46:23 +0000 (16:46 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 30 Aug 2007 16:46:23 +0000 (16:46 +0000)
DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.

* gcc.dg/inline-24.c: New test.
* g++.dg/opt/inline11.C: New test.

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

gcc/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/inline11.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/inline-24.c [new file with mode: 0644]

index 3c3a291..200a353 100644 (file)
@@ -1,5 +1,8 @@
 2007-08-30  Jakub Jelinek  <jakub@redhat.com>
 
+       * decl.c (start_preparsed_function): Set
+       DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
+
        PR target/33168
        * config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Return
        true if any of the compare_section_name calls returned true,
index 3117a7a..ede4ec6 100644 (file)
@@ -10892,6 +10892,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
       DECL_EXTERNAL (decl1) = 1;
       DECL_NOT_REALLY_EXTERN (decl1) = 0;
       DECL_INTERFACE_KNOWN (decl1) = 1;
+      DECL_DISREGARD_INLINE_LIMITS (decl1) = 1;
     }
 
   if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl1))
index 476fc5f..ceb6fa0 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-30  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.dg/inline-24.c: New test.
+       * g++.dg/opt/inline11.C: New test.
+
 2007-08-30  Richard Guenther  <rguenther@suse.de>
 
        * gcc.target/i386/vectorize5.c: New testcase.
diff --git a/gcc/testsuite/g++.dg/opt/inline11.C b/gcc/testsuite/g++.dg/opt/inline11.C
new file mode 100644 (file)
index 0000000..d975817
--- /dev/null
@@ -0,0 +1,28 @@
+/* Verify that gnu_inline inlines disregard inlining limits.  */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern int foo (int);
+extern int baz (int);
+
+extern inline __attribute__((gnu_inline))
+int foo (int x)
+{
+  int i;
+  if (!__builtin_constant_p (x))
+    {
+#define B(n) baz (1##n) + baz (2##n) + baz (3##n) \
+            + baz (4##n) + baz (5##n) + baz (6##n)
+#define C(n) B(1##n) + B(2##n) + B(3##n) + B(4##n) + B(5##n) + B(6##n)
+#define D(n) C(1##n) + C(2##n) + C(3##n) + C(4##n) + C(5##n) + C(6##n)
+      return D(0) + D(1) + D(2) + D(3) + D(4)
+            + D(5) + D(6) + D(7) + D(8) + D(9);
+    }
+  return 0;
+}
+
+int
+main (void)
+{
+  return foo (0);
+}
diff --git a/gcc/testsuite/gcc.dg/inline-24.c b/gcc/testsuite/gcc.dg/inline-24.c
new file mode 100644 (file)
index 0000000..d975817
--- /dev/null
@@ -0,0 +1,28 @@
+/* Verify that gnu_inline inlines disregard inlining limits.  */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern int foo (int);
+extern int baz (int);
+
+extern inline __attribute__((gnu_inline))
+int foo (int x)
+{
+  int i;
+  if (!__builtin_constant_p (x))
+    {
+#define B(n) baz (1##n) + baz (2##n) + baz (3##n) \
+            + baz (4##n) + baz (5##n) + baz (6##n)
+#define C(n) B(1##n) + B(2##n) + B(3##n) + B(4##n) + B(5##n) + B(6##n)
+#define D(n) C(1##n) + C(2##n) + C(3##n) + C(4##n) + C(5##n) + C(6##n)
+      return D(0) + D(1) + D(2) + D(3) + D(4)
+            + D(5) + D(6) + D(7) + D(8) + D(9);
+    }
+  return 0;
+}
+
+int
+main (void)
+{
+  return foo (0);
+}