Hi,

tree_inlinable_function_p issues the -Winline warning only if

  /* We only warn for functions declared `inline' by the user.  */
  do_warning = (warn_inline
                && DECL_DECLARED_INLINE_P (fn)
                && !DECL_NO_INLINE_WARNING_P (fn)
                && !DECL_IN_SYSTEM_HEADER (fn));

is true, so in particular only if DECL_NO_INLINE_WARNING_P is not set.  Now 
expand_call_inline also issues the -Winline warning

      else if (warn_inline && DECL_DECLARED_INLINE_P (fn)
               && !DECL_IN_SYSTEM_HEADER (fn)
               && reason != CIF_UNSPECIFIED
               && !lookup_attribute ("noinline", DECL_ATTRIBUTES (fn))
               /* Do not warn about not inlined recursive calls.  */
               && !cgraph_edge_recursive_p (cg_edge)
               /* Avoid warnings during early inline pass. */
               && cgraph_global_info_ready)

but disregards the DECL_NO_INLINE_WARNING_P flag.

Tested on i586-suse-linux, OK for the mainline?


2011-04-19  Eric Botcazou  <ebotca...@adacore.com>

        * tree-inline.c (expand_call_inline): Do not issue a -Winline warning
        if DECL_NO_INLINE_WARNING_P is set on the function.


-- 
Eric Botcazou
Index: tree-inline.c
===================================================================
--- tree-inline.c	(revision 172693)
+++ tree-inline.c	(working copy)
@@ -3744,7 +3744,9 @@ expand_call_inline (basic_block bb, gimp
 		 _(cgraph_inline_failed_string (reason)));
 	  sorry ("called from here");
 	}
-      else if (warn_inline && DECL_DECLARED_INLINE_P (fn)
+      else if (warn_inline
+	       && DECL_DECLARED_INLINE_P (fn)
+	       && !DECL_NO_INLINE_WARNING_P (fn)
 	       && !DECL_IN_SYSTEM_HEADER (fn)
 	       && reason != CIF_UNSPECIFIED
 	       && !lookup_attribute ("noinline", DECL_ATTRIBUTES (fn))

Reply via email to