public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Cc: Jan Hubicka <hubicka@ucw.cz>
Subject: [PATCH] middle-end/108086 - avoid unshare_expr when remapping SSA names
Date: Fri, 16 Dec 2022 12:05:31 +0000 (UTC)	[thread overview]
Message-ID: <20221216120531.HgsnC2j-HDckZ9Io-an0gC01pv2MpZSVex5ZulaW6FM@z> (raw)

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

             reply	other threads:[~2022-12-16 12:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 12:05 Richard Biener [this message]
2023-01-18 13:56 Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221216120531.HgsnC2j-HDckZ9Io-an0gC01pv2MpZSVex5ZulaW6FM@z \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).