From patchwork Thu Sep 12 20:06:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teresa Johnson X-Patchwork-Id: 274604 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 89BAC2C0399 for ; Fri, 13 Sep 2013 06:06:20 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=x5Ohtmq633YHOGJwB78B12OmIHoDdo0dvtvz/z8cnVGk6k st4BMyTlnJXy5+KtmLhx9Vxu2sYJqmhY8C8ZStpfmwnpYmfDemBRVZljPNH1/qTE wktYkU6PTqcDrZ0skK2slnNP2ePWmx9kWoiqPLKeXC0rUOF9Tgi79u8RnRiWU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=PcKkKIez/rjAHveUEAjTDn3ezzc=; b=T1hWSm6JuyTEN5j+g+zk 7kvWFhmFbh61o51pIYNTmqdg5FQA1jfxEDa88UasbCL5oOkYS0MsdxNblBhzWHnf z7/CngMRkz1pvmSI4HK/U5uZOkzhx+W4dU9vmq5C0u3pcdmhY9dDVp+g0pyhGIa1 cg46gzrSnNeTsnOaeR40KpE= Received: (qmail 16096 invoked by alias); 12 Sep 2013 20:06:14 -0000 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 Received: (qmail 16082 invoked by uid 89); 12 Sep 2013 20:06:13 -0000 Received: from mail-qc0-f169.google.com (HELO mail-qc0-f169.google.com) (209.85.216.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 12 Sep 2013 20:06:13 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, NO_RELAYS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f169.google.com Received: by mail-qc0-f169.google.com with SMTP id c9so224369qcz.14 for ; Thu, 12 Sep 2013 13:06:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=XqkgoXPKK1OtVGQ4tjjdREu203fHr12qNxnaIt5zFrw=; b=ATgS1lg9izzU231zMbZOGbXOS4LL16AbzPxx/0j/MOapkB+Kdi44oYZ8R1ZYWmXP/t MXsiD1QiGn+jddgFw0guWwMha57dfq+0gmIV3aIOMHjZPZlExFNsXqN1uhqIyFjacSGQ iI8kJWM+yJe+NsrD6Z0R0cEmperHahBatv//5PSO0eQZDm9qEVZDLyOSkguAs+fJ8Jyw 5h+4eTqWhWyURopR8a6g1NqzpD/5HR3e3gcGTjv5TJcjrpp8Xe0Mk8GP3GU+iVm/1hH5 o2JG6kWuWTLsJggIycekiwU/MtRWw0gXm69fsu4Lywg7rIGxpwnSDK538yBDq8PwSR3n Xzrg== X-Gm-Message-State: ALoCoQnur9uMGyuiE7wLDG4HBhjpF0QkKaPnloPOuWkUal9gkjmXhIygG+jU0NwkTwpDRLocuCutysgDqHOMvwjkXsifteWeIpq6nTex5IyJhbH+YZtQVYeT2VoG4Srd25QfZX8wcSegc3gxqYi9/Y9D4AOEgCh80YjHRnUadzBXiPY9t3ZHUiscXJUUgcfk2iOUuuQZoq2fgW84rnv3U8ThQ11fMypeLA== MIME-Version: 1.0 X-Received: by 10.49.62.3 with SMTP id u3mr16887535qer.6.1379016371002; Thu, 12 Sep 2013 13:06:11 -0700 (PDT) Received: by 10.49.24.225 with HTTP; Thu, 12 Sep 2013 13:06:10 -0700 (PDT) Date: Thu, 12 Sep 2013 13:06:10 -0700 Message-ID: Subject: [Google] Fix test failure after porting __gcov_get_profile_prefix from google/4_7 From: Teresa Johnson To: "gcc-patches@gcc.gnu.org" , David Li X-IsSubscribed: yes After porting r198033 from google/4_7 to google/4_8 a test case failed with an assert when trying to take the strlen of profile_data_prefix. In most cases this is either set from the directory specified to -fprofile-generate=, or to getpwd when a directory is not specified. However, the exception is when no directory is specified for -fprofile-generate and -auxbase-strip option is used with the absolute pathname. In that case the code does not set profile_data_prefix since the filenames already have the full path. In the code that sets __gcov_get_profile_prefix, the fix is to simply check if profile_data_prefix is still NULL, and if so just set via getpwd. Passes regression tests and failure I reproduced. Ok for google branches? Thanks, Teresa 2013-09-12 Teresa Johnson * tree-profile.c (tree_init_instrumentation): Handle the case where profile_data_prefix is NULL. Index: tree-profile.c =================================================================== --- tree-profile.c (revision 202500) +++ tree-profile.c (working copy) @@ -470,8 +470,11 @@ tree_init_instrumentation (void) DECL_ASSEMBLER_NAME (gcov_profile_prefix_decl)); TREE_STATIC (gcov_profile_prefix_decl) = 1; - prefix_len = strlen (profile_data_prefix); - prefix_string = build_string (prefix_len + 1, profile_data_prefix); + const char *prefix = profile_data_prefix; + if (!prefix) + prefix = getpwd (); + prefix_len = strlen (prefix); + prefix_string = build_string (prefix_len + 1, prefix); TREE_TYPE (prefix_string) = build_array_type (char_type_node, build_index_type (build_int_cst (NULL_TREE, prefix_len)));