public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Add missing test for DECL_NO_INLINE_WARNING_P
@ 2011-04-19 11:58 Eric Botcazou
  2011-04-19 12:08 ` Richard Guenther
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Botcazou @ 2011-04-19 11:58 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]

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  <ebotcazou@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

[-- Attachment #2: p.diff --]
[-- Type: text/x-diff, Size: 616 bytes --]

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))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Add missing test for DECL_NO_INLINE_WARNING_P
  2011-04-19 11:58 [patch] Add missing test for DECL_NO_INLINE_WARNING_P Eric Botcazou
@ 2011-04-19 12:08 ` Richard Guenther
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Guenther @ 2011-04-19 12:08 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches

On Tue, Apr 19, 2011 at 1:06 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> 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?

Ok.

Thanks,
Richard.

>
> 2011-04-19  Eric Botcazou  <ebotcazou@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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-19 11:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-19 11:58 [patch] Add missing test for DECL_NO_INLINE_WARNING_P Eric Botcazou
2011-04-19 12:08 ` Richard Guenther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).