From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id C3EE13856B70 for ; Fri, 16 Dec 2022 12:05:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C3EE13856B70 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id EA89533FFD; Fri, 16 Dec 2022 12:05:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671192331; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=eBQbdyLt3z+oFCEGmW4+R76PAWVEb6rmWgme4DQIm/E=; b=2NgYdPJmYXSIrKpA1WhNAlMxVpBBgCAqSgXnvZdYCWjMtnRc72rQyKUU+ihKAf5E1Tfp3t 0egH0hK7dTHAxGyQ+DLHXrzYsUvgt50rZ2LQgFn4CWwnIR+4Pi5uzY5V4GBaR1RKAwYvgx XZQ8rZGrlPQnZEAf3qRJvlcaBC/RJ88= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671192331; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=eBQbdyLt3z+oFCEGmW4+R76PAWVEb6rmWgme4DQIm/E=; b=uV7XWwjMmbDrtPLMs5m4HaQBXuw1e+sJ2toLNmwiumPLTpcjr9/qsQ0G8WSsFtNrDZSgaa aohu6HCSxoXcLxCw== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id DE2462C141; Fri, 16 Dec 2022 12:05:31 +0000 (UTC) Date: Fri, 16 Dec 2022 12:05:31 +0000 (UTC) From: Richard Biener To: gcc-patches@gcc.gnu.org cc: Jan Hubicka Subject: [PATCH] middle-end/108086 - avoid unshare_expr when remapping SSA names User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,MISSING_MID,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Message-ID: <20221216120531.HgsnC2j-HDckZ9Io-an0gC01pv2MpZSVex5ZulaW6FM@z> r0-89280-g129a37fc319db8 added unsharing to remap_ssa_name but that wasn't in the version of the patch posted. That has some non-trivial cost through mostly_copy_tree_r and copy_tree_r but more importantly it doesn't seem to be necessary. I've successfully bootstrapped and tested with an assert we only get tree_node_can_be_shared trees here. Bootstrapped and tested on x86_64-unknown-linux-gnu with all languages. Pushed to trunk. PR middle-end/108086 * tree-inline.cc (remap_ssa_name): Do not unshare the result from the decl_map. --- gcc/tree-inline.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc index c802792fa07..b471774ce51 100644 --- a/gcc/tree-inline.cc +++ b/gcc/tree-inline.cc @@ -183,7 +183,7 @@ remap_ssa_name (tree name, copy_body_data *id) return name; } - return unshare_expr (*n); + return *n; } if (processing_debug_stmt) -- 2.35.3