aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorChristian Bruel <chrbr@gcc.gnu.org>2011-06-21 08:42:05 +0200
committerChristian Bruel <chrbr@gcc.gnu.org>2011-06-21 08:42:05 +0200
commitc9fc06dcdd6568fa4a54d10408098ec51d07234f (patch)
tree8dd93dc6abd84a32b62b4e2bfae943c2c673d753 /gcc/cgraphunit.c
parentf1ee724ceb567af3f1343ceac6d87a69abc9c800 (diff)
downloadgcc-c9fc06dcdd6568fa4a54d10408098ec51d07234f.zip
gcc-c9fc06dcdd6568fa4a54d10408098ec51d07234f.tar.gz
gcc-c9fc06dcdd6568fa4a54d10408098ec51d07234f.tar.bz2
PR middle-end/49139 fix always_inline diagnostics
From-SVN: r175239
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 6683d2a..de9bbe3 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -986,6 +986,14 @@ process_function_and_variable_attributes (struct cgraph_node *first,
DECL_ATTRIBUTES (decl) = remove_attribute ("weakref",
DECL_ATTRIBUTES (decl));
}
+
+ if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (decl))
+ && !DECL_DECLARED_INLINE_P (decl)
+ /* redefining extern inline function makes it DECL_UNINLINABLE. */
+ && !DECL_UNINLINABLE (decl))
+ warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wattributes,
+ "always_inline function might not be inlinable");
+
process_common_attributes (decl);
}
for (vnode = varpool_nodes; vnode != first_var; vnode = vnode->next)