public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mike Stump <mikestump@comcast.net>
To: Laurynas Biveinis <laurynas.biveinis@gmail.com>
Cc: Jeff Law <law@redhat.com>,
	Steven Bosscher <stevenb.gcc@gmail.com>,
	gcc-patches@gcc.gnu.org,
	Richard Guenther <richard.guenther@gmail.com>
Subject: Re: [gc-improv] Permanent vs function RTL obstack fix
Date: Tue, 12 Apr 2011 17:25:00 -0000	[thread overview]
Message-ID: <FC90EEF4-1FF9-4558-BB7A-632B823EE121@comcast.net> (raw)
In-Reply-To: <BANLkTikFrcCNTxAThfbPF8YMrZ+-wuTwwg@mail.gmail.com>

On Apr 12, 2011, at 4:46 AM, Laurynas Biveinis wrote:
>> So what's the plan for the case where you need to change the lifetime of
>> an object?
> 
> Copying it.  Frankly at the moment I don't how much trouble does deep
> copying from scratch to function entails,

The code to copy isn't too hard and if fairly simple to understand, test and do.  Roughly, you just need to understand how deep you have to copy, part of this is ensuring you iterator over all the pointers in the objects that might point to the shorter lifetime.

The problems of the past would be, all the other folks that have live pointers into anything which is copied.  You have the first pointer and that is trivial to change, but all the other pointers could be problematic.  Some of the problems were when some of the pointers pointed to the new and some of the pointers pointed to the old, then, for all the data hanging off those data structures that were supposed to be single pieces of data, there were now two copies of that data.  Imagine if you had two TREE_ASM_WRITTENs for a `single' decl.  RTL is vastly simpler than a _DECL node.  For just generated RTL (combine temp rtl building), I would not expect any problems.  Likewise scratch to function, those should be easy enough.  Harder are function to anything longer, say, permanent.

      reply	other threads:[~2011-04-12 17:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07  6:17 Laurynas Biveinis
2011-04-07 21:33 ` Steven Bosscher
2011-04-08 13:22   ` Laurynas Biveinis
2011-04-08 14:36     ` Jeff Law
2011-04-08 14:39       ` Richard Guenther
2011-04-08 14:42         ` Jeff Law
2011-04-09 10:34       ` Steven Bosscher
2011-04-10 18:27         ` Laurynas Biveinis
2011-04-10 18:49           ` Basile Starynkevitch
2011-04-11 20:03           ` Jeff Law
2011-04-12  0:22             ` Mike Stump
2011-04-12  2:54               ` Jeff Law
2011-04-12  6:34                 ` Steven Bosscher
2011-04-12  7:01                   ` Jakub Jelinek
2011-04-12  8:45                     ` Steven Bosscher
2011-04-12 10:44                       ` Mike Stump
2011-04-12 10:49                         ` Steven Bosscher
2011-04-12 15:02                       ` Jeff Law
2011-04-12 11:56             ` Bernd Schmidt
2011-04-12 15:31               ` Jeff Law
2011-04-10 18:23       ` Laurynas Biveinis
2011-04-10 22:33         ` Steven Bosscher
2011-04-11 20:08         ` Jeff Law
2011-04-12 11:43           ` Laurynas Biveinis
2011-04-12 11:46             ` Laurynas Biveinis
2011-04-12 17:25               ` Mike Stump [this message]

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=FC90EEF4-1FF9-4558-BB7A-632B823EE121@comcast.net \
    --to=mikestump@comcast.net \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=laurynas.biveinis@gmail.com \
    --cc=law@redhat.com \
    --cc=richard.guenther@gmail.com \
    --cc=stevenb.gcc@gmail.com \
    /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).