diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-08-30 18:46:23 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-08-30 18:46:23 +0200 |
commit | 12cdc4fa8647b21f11d5f4b091d54f34e7220853 (patch) | |
tree | f0d95222445794391ea88b9790754360b5bb452f | |
parent | ca2ba153a602f34f2bfc76b106345c9fe7aa21f0 (diff) | |
download | gcc-12cdc4fa8647b21f11d5f4b091d54f34e7220853.zip gcc-12cdc4fa8647b21f11d5f4b091d54f34e7220853.tar.gz gcc-12cdc4fa8647b21f11d5f4b091d54f34e7220853.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/decl.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/inline11.C | 28 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/inline-24.c | 28 |
5 files changed, 65 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3c3a291..200a353 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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, diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3117a7a..ede4ec6 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 476fc5f..ceb6fa0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..d975817 --- /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 0000000..d975817 --- /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); +} |