From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41243 invoked by alias); 11 Sep 2018 09:23:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 41234 invoked by uid 89); 11 Sep 2018 09:23:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.4 required=5.0 tests=BAYES_00,GIT_PATCH_2,KAM_NUMSUBJECT,KAM_SHORT,SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Sep 2018 09:23:46 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 66EEBAFB6; Tue, 11 Sep 2018 09:23:44 +0000 (UTC) Subject: Re: [PATCH] PR86957 To: Indu Bhagat , gcc-patches@gcc.gnu.org References: From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <43809a8f-20e1-9fbb-e641-4006999d75df@suse.cz> Date: Tue, 11 Sep 2018 09:23:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00528.txt.bz2 On 09/05/2018 09:28 PM, Indu Bhagat wrote: > Patch for PR 86957 " gcc should warn about missing profiles for a compilation unit or a new function with -fprofile-use". > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86957 > > The patch adds -Wmissing-profile warning flag to alert user about cases when there is no profile data for a compilation unit or a function when using -fprofile-use. > > The flag is on by default when -fprofile-use is specified and generates errors > by default (like -Wcoverage-mismatch). > > The attachment pr86957-missing-profile-diagnostic shows the behavior of GCC with the patch. > > Thanks > Indu > > ------------------------------------------------------ > > > gcc/ChangeLog: > > 2018-09-05  "Indu Bhagat"  <"indu.bhagat@oracle.com"> > >         * common.opt: New warning option -Wmissing-profile. >         * coverage.c (get_coverage_counts): Add warning for missing .gcda file. >         * doc/invoke.texi: Document -Wmissing-profile. >         * profile.c (get_exec_counts): Add warning for missing feedback >           profile for a function. >         * toplev.c (process_options): -Wmissing-profile warning as error. > ... and please add a test-case for the missing file. That's easy to achieve by running a test-case with -fprofile-use. Martin