From patchwork Tue Apr 19 11:06:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 91953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 9B033B6FF0 for ; Tue, 19 Apr 2011 21:12:38 +1000 (EST) Received: (qmail 27506 invoked by alias); 19 Apr 2011 11:12:36 -0000 Received: (qmail 27497 invoked by uid 22791); 19 Apr 2011 11:12:36 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Apr 2011 11:12:22 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 850B2CB0243 for ; Tue, 19 Apr 2011 13:12:20 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H8r42DJDLO+k for ; Tue, 19 Apr 2011 13:12:17 +0200 (CEST) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 78F5DCB020C for ; Tue, 19 Apr 2011 13:12:17 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Add missing test for DECL_NO_INLINE_WARNING_P Date: Tue, 19 Apr 2011 13:06:29 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201104191306.29559.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * tree-inline.c (expand_call_inline): Do not issue a -Winline warning if DECL_NO_INLINE_WARNING_P is set on the function. 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))