diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2002-02-22 00:09:04 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2002-02-22 00:09:04 +0000 |
commit | 6aa77e6c394b8d61c25d146e7d106f4ddf17ca54 (patch) | |
tree | 81ecf94407355c68f26f5bc1ca604c5ff588e9da /gcc/testsuite/gcc.dg/attr-alwaysinline.c | |
parent | c410d49e434d06e93c9163eda0a26891e6116a7e (diff) | |
download | gcc-6aa77e6c394b8d61c25d146e7d106f4ddf17ca54.zip gcc-6aa77e6c394b8d61c25d146e7d106f4ddf17ca54.tar.gz gcc-6aa77e6c394b8d61c25d146e7d106f4ddf17ca54.tar.bz2 |
attr-alwaysinline.c: New.
2002-02-21 Aldy Hernandez <aldyh@redhat.com>
* gcc.dg/attr-alwaysinline.c: New.
* c-common.c (c_common_post_options): Set inline trees by
default.
* doc/extend.texi (Function Attributes): Document always_inline
attribute.
Update documentation about inlining when not optimizing.
* cp/decl.c (duplicate_decls): Merge always_inline attribute.
* cp/tree.c (cp_cannot_inline_tree_fn): Do not inline at -O0
unless DECL_ALWAYS_INLINE.
* c-objc-common.c (c_cannot_inline_tree_fn): Do not inline at -O0
unless DECL_ALWAYS_INLINE.
(c_disregard_inline_limits): Disregard if always_inline set.
* langhooks.c (lhd_tree_inlining_disregard_inline_limits):
Disregard if always_inline set.
(lhd_tree_inlining_cannot_inline_tree_fn): Do not inline at -O0
unless DECL_ALWAYS_INLINE.
* attribs.c (handle_always_inline_attribute): New.
(c_common_attribute_table): Add always_inline.
* config/rs6000/altivec.h: Add prototypes for builtins
requiring the always_inline attribute.
From-SVN: r49947
Diffstat (limited to 'gcc/testsuite/gcc.dg/attr-alwaysinline.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/attr-alwaysinline.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/attr-alwaysinline.c b/gcc/testsuite/gcc.dg/attr-alwaysinline.c new file mode 100644 index 0000000..8ff92b2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/attr-alwaysinline.c @@ -0,0 +1,19 @@ +/* Test always_inline attribute, which forces inlining of functions + even at no optimization. */ +/* Origin: Aldy Hernandez <aldyh@redhat.com>. */ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +static inline int sabrina (void) __attribute__((always_inline)); + +static inline int sabrina (void) +{ + return 13; +} + +int bar (void) +{ + return sabrina () + 68; +} + +/* { dg-final { scan-assembler-not "sabrina" } } */ |