public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernd Schmidt <bernds@codesourcery.com>
To: Jeff Law <law@redhat.com>
Cc: Laurynas Biveinis <laurynas.biveinis@gmail.com>,
	 Steven Bosscher <stevenb.gcc@gmail.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [gc-improv] Permanent vs function RTL obstack fix
Date: Tue, 12 Apr 2011 11:56:00 -0000	[thread overview]
Message-ID: <4DA43D74.6080703@codesourcery.com> (raw)
In-Reply-To: <4DA35E74.1020506@redhat.com>

On 04/11/2011 10:03 PM, Jeff Law wrote:
> One of the fundamental problems you have to watch out for when dealing
> with scratch objects is how to handle the case when you belatedly
> realize you want the object to have a longer lifetime.

Historically, our problems with obstacks were a consequence of
line-by-line processing of the input file and never being quite certain
where a given object would have to end up. Almost all of that is simply
no longer an issue, which means RTL memory management is conceptually a
lot simpler than it used to be. A few things (constants, mostly) are
shared and must be permanent, the rest can go a single per-function
obstack which is freed after every function. I don't think we should (or
need to) try to have more obstacks for RTL.

I also don't see why a deep copy to the permanent obstack would be a
source of problems these days. More common than wanting to do that
however is the opposite case where you can speculatively generate RTL on
the function obstack, see if it's valid, and if not reset the obstack to
the earlier point to reclaim the memory. I know that reload and combine
could be made more efficient this way, and I'd guess the same is true
for fwprop.

I'd also like to point out that I share Steven's experience that the GC
stuff doesn't "just work"; I've certainly had objects collected from
under me and needed to puzzle out where to sprinkle the necessary GTY
markers.


Bernd

  parent reply	other threads:[~2011-04-12 11:56 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 [this message]
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

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=4DA43D74.6080703@codesourcery.com \
    --to=bernds@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=laurynas.biveinis@gmail.com \
    --cc=law@redhat.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).