From patchwork Sat Aug 23 18:42:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teresa Johnson X-Patchwork-Id: 382451 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 988251400AA for ; Sun, 24 Aug 2014 04:42:15 +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:cc:content-type; q=dns; s=default; b=FQwuM2VDOJTY9qnlWyvNQZ9mB2AkEIb7HLKP/4xjlr8 KwoXEJ0rSFEIfI5yjJSC3RmcwTdtOUNTfDNS151f5jl62eS2p0S6n+H1hS3Kg4UQ 5fTswe1TzEuk5wsIl3b5sJjI8CBwRWqgmTLpG+BURTiFrFh2Ba/fzVUwKhjXVptI = 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:cc:content-type; s=default; bh=errEurTAEkyotohjND4feysq0xE=; b=gGshQFhgjiogRureX vO2ubYRFlA6SDFLhxdk6HktggIjoFLqGfGydlaco4HkUy8ZeS3B1RvSpXHkrx34H cByM923kseI8EX3z8uNatiaxxjuKiW8Zy9hjvD2Qkm67FBUi4vVFPLVvoSe7QwjG X38bWmMNUN0n5MCmiFLBthdgSU= Received: (qmail 23944 invoked by alias); 23 Aug 2014 18:42:09 -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 23935 invoked by uid 89); 23 Aug 2014 18:42:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f180.google.com Received: from mail-qc0-f180.google.com (HELO mail-qc0-f180.google.com) (209.85.216.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 23 Aug 2014 18:42:08 +0000 Received: by mail-qc0-f180.google.com with SMTP id l6so12173647qcy.39 for ; Sat, 23 Aug 2014 11:42:06 -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:cc :content-type; bh=BuoboGsYApD1lNptGf4PTH0sQCeKX6Ju9NFWvAbvdys=; b=b0hFHDVPvB8hzpGXDdPTlqcU3vcXyb7l6dnfJkU45dSF27ANYtbILdGx88rUrQkI/L F11luLfQSYTb+ZWgTzWQwrWmT5i22PgeNQURP+HrOmXVgUICzvNfNR3y9OCTN30qI27Q vbzlV8Gs6ztkNbkLGSaA8nzn/uRwz5b2zqJBW8JFsT5NHNjMlfN0+r/bHZtEy1gu3UQN Q0KCYTgQN1/O9QZjZAvXmEMWwBsO/6s5QK1xPaljYCab9DD9YySqciFbK58HICRtwXzy jJujfyhfLthRRALwu7vcZzjMW8PMpsZMTSsh1cz+pUOzJ5ZmPBlAlRcluThmZfkU1RVn t8GQ== X-Gm-Message-State: ALoCoQmbWDUUBnF9pI1vjpNKhzMxRmccsSCPyJMTEP48bWSzenz0BRLJaQzQtQc7naVyBm+eirn3 MIME-Version: 1.0 X-Received: by 10.229.140.70 with SMTP id h6mr19639292qcu.3.1408819326147; Sat, 23 Aug 2014 11:42:06 -0700 (PDT) Received: by 10.229.126.201 with HTTP; Sat, 23 Aug 2014 11:42:06 -0700 (PDT) Date: Sat, 23 Aug 2014 11:42:06 -0700 Message-ID: Subject: [GOOGLE] Fix -fopt-info seg fault in AutoFDO LIPO mode From: Teresa Johnson To: "gcc-patches@gcc.gnu.org" , David Li Cc: Dehao Chen X-IsSubscribed: yes Fixes seg fault when using -fopt-info with AutoFDO LIPO. Ensure that the mapping between module name and ident is setup. Tested with regression tests and internal benchmarks. Ok for google/4_9 2014-08-23 Teresa Johnson Google ref b/17124135 * auto-profile.c (read_aux_modules): Record the module name/ident pair. * coverage.c (record_module_name): Make non-static. * l-ipo.h (record_module_name): Ditto. Index: auto-profile.c =================================================================== --- auto-profile.c (revision 214320) +++ auto-profile.c (working copy) @@ -958,6 +958,7 @@ read_aux_modules (void) module_infos = XCNEWVEC (gcov_module_info *, num_aux_modules + 1); module_infos[0] = module; primary_module_id = module->ident; + record_module_name (module->ident, lbasename (in_fnames[0])); if (aux_modules == NULL) return; unsigned curr_module = 1, max_group = PARAM_VALUE (PARAM_MAX_LIPO_GROUP); @@ -1004,6 +1005,7 @@ read_aux_modules (void) } module_infos[curr_module++] = aux_module; add_input_filename (*iter); + record_module_name (aux_module->ident, lbasename (*iter)); } } Index: coverage.c =================================================================== --- coverage.c (revision 214320) +++ coverage.c (working copy) @@ -658,7 +658,7 @@ typedef struct { static vec *mod_names; -static void +void record_module_name (unsigned int mod_id, const char *name) { mod_id_to_name_t t; Index: l-ipo.h =================================================================== --- l-ipo.h (revision 214320) +++ l-ipo.h (working copy) @@ -63,6 +63,7 @@ int equivalent_struct_types_for_tbaa (const_tree t void lipo_link_and_fixup (void); extern void copy_defined_module_set (tree, tree); extern bool is_parsing_done_p (void); +extern void record_module_name (unsigned int, const char *); extern const char* get_module_name (unsigned int); #endif