From patchwork Tue Apr 12 15:40:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 609471 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 3qkrjh6HRGz9t43 for ; Wed, 13 Apr 2016 01:40:24 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=pxI98JwB; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=HjsdFfKlykidGQ4wX h6/zsWvNxVcZyD8FnZJ4KWqtEXVm7UjwcMBS4dB/OEPmvfn+ZICUlXjcpJLmfQPG zfaUddCEeAsCoqZegQOgbihqfQlSTHzLIOSDoAiJ9IwWBXnJN5haoHp6uXjfrjTR x3TH5LPjwXUef1N5eNcpuK8fTc= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=JJ2MSLwnzu2SX3FKHWyMDbC LH3s=; b=pxI98JwBJu+fxvu6bOec2GQb0Vunu6XISyk+A93RaL2nz6cIIoHoOVu l5n71g4chy2sgJG+kVoTa7c0HH7fespkSSMPr1N6VgnGc8i0WQ+NoFEEQCXZlQdi YuzPOrO954sKZrUpe7XCUFFUcwFerDku8JrVA75TrbBKaDei9W0I= Received: (qmail 78588 invoked by alias); 12 Apr 2016 15:40: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 78578 invoked by uid 89); 12 Apr 2016 15:40:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=BAYES_00, FREEMAIL_FROM, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:2028, H*MI:sk:2016041 X-HELO: mail-qg0-f68.google.com Received: from mail-qg0-f68.google.com (HELO mail-qg0-f68.google.com) (209.85.192.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 12 Apr 2016 15:40:12 +0000 Received: by mail-qg0-f68.google.com with SMTP id 7so2007532qgj.0 for ; Tue, 12 Apr 2016 08:40:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to; bh=pGKl5suZgGMyygbXfUEli2H9pYo/31E3BorMsjvD3Ns=; b=X/Iu5MydZyjGXwsyf4oEeM4L3QDgs9VMDU3SQ1tNbYhnAq5vCwkynXx2/y3Uxky3xW iQLMhUY8gKdbRYuRe0CocfM9pBD17VjvKMpR9aivY3GrXF8EMWfdYWwRMOKKCGjQG9af Z59gh6V4Ue+u69n9C/8m2eYynfiHAFYYEIKDXAUHyKu5F4aKeMPi2CR6OMscV1X0faKE 4aB6JFhV6DpuvWNOy97ZugMo5lrAOqzG6bpFUQQS3hnIuGCL/af0f8omCMhVqAY41dKF CPvaoakE4CBZ57rUUXonsWWnyAxHre8thC6XpQuVvMIWo1fwOf8XvxZT6q410YxDy5dX hLow== X-Gm-Message-State: AOPr4FUUKNu4mlbtvbKS01vd72/qgoSpwC5ZfjI5dVNaybfNZRSAx75AMPetjUdllqICuw== X-Received: by 10.140.179.15 with SMTP id z15mr4956503qhz.79.1460475610406; Tue, 12 Apr 2016 08:40:10 -0700 (PDT) Received: from ?IPv6:2601:181:c003:1930:a2a8:cdff:fe3e:b48? ([2601:181:c003:1930:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id i46sm13816339qgd.19.2016.04.12.08.40.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Apr 2016 08:40:09 -0700 (PDT) Subject: Re: [PATCH] c++/70594 debug info differences To: Jakub Jelinek , Jason Merrill References: <570BFE33.4030305@acm.org> <570CF588.8020006@redhat.com> <570CFE63.2010209@acm.org> <570D0617.6090201@redhat.com> <20160412143246.GU19207@tucnak.redhat.com> <570D0BE2.601@redhat.com> <20160412151956.GY19207@tucnak.redhat.com> Cc: Patrick Palka , GCC Patches , Richard Guenther From: Nathan Sidwell Message-ID: <570D16D8.9000002@acm.org> Date: Tue, 12 Apr 2016 11:40:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160412151956.GY19207@tucnak.redhat.com> On 04/12/16 11:19, Jakub Jelinek wrote: > On Tue, Apr 12, 2016 at 10:53:22AM -0400, Jason Merrill wrote: >> It doesn't seem that dangerous to me. The decls are only used within >> constexpr evaluation, they never escape. > > The uids can be used in hashing, folding, for the various on the side > tables (value-expr, debug-expr, ...). FWIW this proof-of-concept patch showed no testsuite regressions. nathan Index: tree.c =================================================================== --- tree.c (revision 234902) +++ tree.c (working copy) @@ -1128,6 +1128,8 @@ free_node (tree node) /* Return a new node with the same contents as NODE except that its TREE_CHAIN, if it has one, is zero and it has a fresh uid. */ +bool clone_uid; + tree copy_node_stat (tree node MEM_STAT_DECL) { @@ -1149,7 +1151,9 @@ copy_node_stat (tree node MEM_STAT_DECL) if (TREE_CODE_CLASS (code) == tcc_declaration) { - if (code == DEBUG_EXPR_DECL) + if (clone_uid) + DECL_UID (t) = DECL_UID (node); + else if (code == DEBUG_EXPR_DECL) DECL_UID (t) = --next_debug_decl_uid; else { Index: tree-inline.c =================================================================== --- tree-inline.c (revision 234902) +++ tree-inline.c (working copy) @@ -6100,6 +6100,18 @@ build_duplicate_type (tree type) return type; } +static tree +copy_decl_no_change_uid (tree decl, copy_body_data *id) +{ + extern bool clone_uid; + + clone_uid = true; + tree r = copy_decl_no_change (decl, id); + clone_uid = false; + + return r; +} + /* Unshare the entire DECL_SAVED_TREE of FN and return the remapped parameters and RESULT_DECL in PARMS and RESULT. Used by C++ constexpr evaluation. */ @@ -6120,7 +6132,7 @@ copy_fn (tree fn, tree& parms, tree& res id.src_cfun = DECL_STRUCT_FUNCTION (fn); id.decl_map = &decl_map; - id.copy_decl = copy_decl_no_change; + id.copy_decl = copy_decl_no_change_uid; id.transform_call_graph_edges = CB_CGE_DUPLICATE; id.transform_new_cfg = false; id.transform_return_to_modify = false;