From patchwork Tue Feb 12 21:38:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teresa Johnson X-Patchwork-Id: 219992 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 860272C0091 for ; Wed, 13 Feb 2013 08:38:49 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1361309930; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:To:Subject:Message-Id:Date:From:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=Vm8uH/Vl3J3INUUETo9K/jmW+/Q=; b=VeYONNL5zI17SolZ9J9uI4smXiTeQSMIV8S6MQX6KS1T1/thi8UwYSTaRPalYX xI5oDWFN3+4RDmJW0gM7v0R9mEKu4Jf6C7fnM8FaQuORoI/lRevTjpfXqQjWwFb8 z8jHCNl3m3/8aVV6hKZsOexoR6R0hm6q9bjyjA0jBaElo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:X-Received:Received:Received:Received:To:Subject:Message-Id:Date:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=c0pHPX07SNA8vJgj8QibJk4VrAS099nSCfgo2Wg6178WT6w/uB1m0nDa6S5SY6 dV2GS+q6P0o7nV5XQHjm8cDC20rlhoNTzj0qt4D1tstBjCFllq2w4zoC+itHdu6W j/U1/KYWNY6Z0V/4Y+XrdY9xe1mBdFmQbC8KSMr0hmvXo=; Received: (qmail 23383 invoked by alias); 12 Feb 2013 21:38:44 -0000 Received: (qmail 23374 invoked by uid 22791); 12 Feb 2013 21:38:43 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, TW_CP, TW_TP X-Spam-Check-By: sourceware.org Received: from mail-qe0-f74.google.com (HELO mail-qe0-f74.google.com) (209.85.128.74) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Feb 2013 21:38:37 +0000 Received: by mail-qe0-f74.google.com with SMTP id a11so60750qen.1 for ; Tue, 12 Feb 2013 13:38:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:to:subject:message-id:date:from:x-gm-message-state; bh=IPSu+AWixEzDUE2C14+ELPiOiFBskOVUeVQjnuzXMTI=; b=GtLSc85fKSgX9F5qgnwo52PC8o5bQWoplWiFaP0wn6FBxiTe2MtqLDNvVsof/oSgkv XH0sQaw9AbVsxA18Cpz2v6r/hzju44bdQNZiqTmxJmDAZcx4nL1cGmuZDerRZh4R1ymp c9tin87WxTbFIgWZePU9hoKSTx/S72txIohVPK5EPOFqTtQ3WNxaclFXcLulkatPpa5n brWxQNeEundGg43Gvv8rE00jrNnVrlV6HqGf+9VFNMiORwD60E0/ycLfEDgPVdGV4AWI R4K/XvvsXd7Bg9d4eEgBonlANenIW3o6Ujc5HHT87ADQ4u2aOIFtpakHxC1KlLsicHuv xDtw== X-Received: by 10.236.159.100 with SMTP id r64mr9005987yhk.20.1360705116361; Tue, 12 Feb 2013 13:38:36 -0800 (PST) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id u21si1901842yhj.0.2013.02.12.13.38.36 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Tue, 12 Feb 2013 13:38:36 -0800 (PST) Received: from tjsboxrox.mtv.corp.google.com (tjsboxrox.mtv.corp.google.com [172.17.129.49]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 30FA931C1CF; Tue, 12 Feb 2013 13:38:36 -0800 (PST) Received: by tjsboxrox.mtv.corp.google.com (Postfix, from userid 147431) id B3CE361568; Tue, 12 Feb 2013 13:38:34 -0800 (PST) To: reply@codereview.appspotmail.com, davidxl@google.com, gcc-patches@gcc.gnu.org Subject: [google 4_7] Fix bad merge into coverage_init (issue7322063) Message-Id: <20130212213835.B3CE361568@tjsboxrox.mtv.corp.google.com> Date: Tue, 12 Feb 2013 13:38:34 -0800 (PST) From: tejohnson@google.com (Teresa Johnson) X-Gm-Message-State: ALoCoQkKEhPvG8ovoPFV5BDRNveA64EGEJ62rHeraYDENsgXF4Qky4RbP8THB8LHqyrpFfOWXKK7CuoWv1Osb45LXGzOaehvhLih6pB9bHE1xahguF/5H+tMiXRHTYaagqJ2igPIOPY3MUyuqJ3qqVI9YEp4KhyE4+m//0hy5Bh0MMe9tBUFkMGOpubsD1krqE3KsI2BuRkk X-IsSubscribed: yes 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 fixes a bad merge from google/integration to google/4_7. Passes regression tests. Ok for google/4_7? Thanks, Teresa 2013-02-12 Teresa Johnson * coverage.c (coverage_init): Move test coverage handling to the correct location within coverage_init (as in trunk) to avoid overlapping gcov_open calls. --- This patch is available for review at http://codereview.appspot.com/7322063 Index: coverage.c =================================================================== --- coverage.c (revision 195984) +++ coverage.c (working copy) @@ -2635,25 +2635,6 @@ coverage_init (const char *filename, const char* s da_base_file_name = XNEWVEC (char, strlen (filename) + 1); strcpy (da_base_file_name, filename); - /* Name of bbg file. */ - if (flag_test_coverage && !flag_compare_debug) - { - bbg_file_name = XNEWVEC (char, len + strlen (GCOV_NOTE_SUFFIX) + 1); - memcpy (bbg_file_name, filename, len); - strcpy (bbg_file_name + len, GCOV_NOTE_SUFFIX); - if (!gcov_open (bbg_file_name, -1)) - { - error ("cannot open %s", bbg_file_name); - bbg_file_name = NULL; - } - else - { - gcov_write_unsigned (GCOV_NOTE_MAGIC); - gcov_write_unsigned (GCOV_VERSION); - gcov_write_unsigned (local_tick); - } - } - if (profile_data_prefix == 0 && !IS_ABSOLUTE_PATH (source_name)) { src_name_prefix = getpwd (); @@ -2698,6 +2679,25 @@ coverage_init (const char *filename, const char* s } if (flag_auto_profile) init_auto_profile (); + + /* Name of bbg file. */ + if (flag_test_coverage && !flag_compare_debug) + { + bbg_file_name = XNEWVEC (char, len + strlen (GCOV_NOTE_SUFFIX) + 1); + memcpy (bbg_file_name, filename, len); + strcpy (bbg_file_name + len, GCOV_NOTE_SUFFIX); + if (!gcov_open (bbg_file_name, -1)) + { + error ("cannot open %s", bbg_file_name); + bbg_file_name = NULL; + } + else + { + gcov_write_unsigned (GCOV_NOTE_MAGIC); + gcov_write_unsigned (GCOV_VERSION); + gcov_write_unsigned (local_tick); + } + } } /* Return True if any type of profiling is enabled which requires linking