From d63bc0133b76e8a2c2f3adf9badfe703459d0bf4 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Wed, 2 Mar 2011 21:11:29 +0800 Subject: [PATCH] gcc44: Don't emit warning about inline failure due to optimization gcc44 tries to guess the hotness of the code path and refuses to inline functions on cold code path even if the function has __inline attribute. The warning caused by this kind of inline failure is extremely annoying and it actually has nothing to do with possible software bugs. --- contrib/gcc-4.4/gcc/tree-inline.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/gcc-4.4/gcc/tree-inline.c b/contrib/gcc-4.4/gcc/tree-inline.c index 83d0eeb7d1..6f1533edfd 100644 --- a/contrib/gcc-4.4/gcc/tree-inline.c +++ b/contrib/gcc-4.4/gcc/tree-inline.c @@ -3249,7 +3249,8 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) && strlen (reason) && !lookup_attribute ("noinline", DECL_ATTRIBUTES (fn)) /* Avoid warnings during early inline pass. */ - && cgraph_global_info_ready) + && cgraph_global_info_ready + && strcmp(reason, "call is unlikely and code size would grow")) { warning (OPT_Winline, "inlining failed in call to %q+F: %s", fn, reason); -- 2.41.0