From patchwork Sat Oct 1 01:12:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sharad Singhai X-Patchwork-Id: 117249 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 50783B6F77 for ; Sat, 1 Oct 2011 11:12:58 +1000 (EST) Received: (qmail 11740 invoked by alias); 1 Oct 2011 01:12:56 -0000 Received: (qmail 11732 invoked by uid 22791); 1 Oct 2011 01:12:55 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 01 Oct 2011 01:12:41 +0000 Received: from hpaq6.eem.corp.google.com (hpaq6.eem.corp.google.com [172.25.149.6]) by smtp-out.google.com with ESMTP id p911Cd19032179; Fri, 30 Sep 2011 18:12:40 -0700 Received: from nabu.mtv.corp.google.com (nabu.mtv.corp.google.com [172.18.110.53]) by hpaq6.eem.corp.google.com with ESMTP id p911CbVk028801; Fri, 30 Sep 2011 18:12:37 -0700 Received: by nabu.mtv.corp.google.com (Postfix, from userid 68019) id 1CF69A6832; Fri, 30 Sep 2011 18:12:37 -0700 (PDT) To: reply@codereview.appspotmail.com, davidxl@google.com, gcc-patches@gcc.gnu.org Subject: Disable early inlining while compiling for coverage (issue5173042) Message-Id: <20111001011237.1CF69A6832@nabu.mtv.corp.google.com> Date: Fri, 30 Sep 2011 18:12:36 -0700 (PDT) From: singhai@google.com (Sharad Singhai) X-System-Of-Record: true 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 This patch disables early inlining when --coverage option is specified. This improves coverage data in presence of other optimizations, specially with -O2 where early inlining changes the control flow graph sufficiently enough to generate seemingly very odd source coverage. Bootstrapped okay and regression tests passed. Okay for google/gcc-4_6? 2011-09-30 Sharad Singhai * gcc.c (cc1_options): Added -fno-early-inlining for coverage. --- This patch is available for review at http://codereview.appspot.com/5173042 Index: gcc.c =================================================================== --- gcc.c (revision 179402) +++ gcc.c (working copy) @@ -776,7 +776,7 @@ %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\ %{fsyntax-only:-o %j} %{-param*}\ %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}\ - %{coverage:-fprofile-arcs -ftest-coverage}"; + %{coverage:-fprofile-arcs -ftest-coverage -fno-early-inlining}"; /* If an assembler wrapper is used to invoke post-assembly tools like MAO, --save-temps need to be passed to save the output of