gcc44: Don't emit warning about inline failure due to optimization
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 2 Mar 2011 13:11:29 +0000 (21:11 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 2 Mar 2011 13:22:55 +0000 (21:22 +0800)
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

index 83d0eeb..6f1533e 100644 (file)
@@ -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);