From 6aa77e6c394b8d61c25d146e7d106f4ddf17ca54 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Fri, 22 Feb 2002 00:09:04 +0000 Subject: attr-alwaysinline.c: New. 2002-02-21 Aldy Hernandez * 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 --- gcc/langhooks.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gcc/langhooks.c') diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 4ad9ae3..c189a3b 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -153,8 +153,12 @@ lhd_tree_inlining_walk_subtrees (tp,subtrees,func,data,htab) int lhd_tree_inlining_cannot_inline_tree_fn (fnp) - tree *fnp ATTRIBUTE_UNUSED; + tree *fnp; { + if (optimize == 0 + && lookup_attribute ("always_inline", DECL_ATTRIBUTES (*fnp)) == NULL) + return 1; + return 0; } @@ -164,8 +168,11 @@ lhd_tree_inlining_cannot_inline_tree_fn (fnp) int lhd_tree_inlining_disregard_inline_limits (fn) - tree fn ATTRIBUTE_UNUSED; + tree fn; { + if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL) + return 1; + return 0; } -- cgit v1.1