From 12cdc4fa8647b21f11d5f4b091d54f34e7220853 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 30 Aug 2007 18:46:23 +0200 Subject: [PATCH] decl.c (start_preparsed_function): Set DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions. * decl.c (start_preparsed_function): Set DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions. * gcc.dg/inline-24.c: New test. * g++.dg/opt/inline11.C: New test. From-SVN: r127929 --- gcc/ChangeLog | 3 +++ gcc/cp/decl.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/opt/inline11.C | 28 ++++++++++++++++++++++++++++ gcc/testsuite/gcc.dg/inline-24.c | 28 ++++++++++++++++++++++++++++ 5 files changed, 65 insertions(+) create mode 100644 gcc/testsuite/g++.dg/opt/inline11.C create mode 100644 gcc/testsuite/gcc.dg/inline-24.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3c3a291c533..200a3531194 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2007-08-30 Jakub Jelinek + * 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, diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3117a7a33eb..ede4ec64273 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 476fc5f1962..ceb6fa05841 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-08-30 Jakub Jelinek + + * gcc.dg/inline-24.c: New test. + * g++.dg/opt/inline11.C: New test. + 2007-08-30 Richard Guenther * 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 index 00000000000..d9758176c61 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/inline11.C @@ -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 index 00000000000..d9758176c61 --- /dev/null +++ b/gcc/testsuite/gcc.dg/inline-24.c @@ -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); +} -- 2.30.2