public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew MacLeod <amacleod@redhat.com>
To: Geoff Keating <geoffk@geoffk.org>
Cc: gcc mailing list <gcc@gcc.gnu.org>
Subject: Re: [tree-ssa][ GC, Virtual operands, and GCing between passes
Date: Thu, 11 Dec 2003 14:17:00 -0000	[thread overview]
Message-ID: <1071150789.10274.8.camel@p4> (raw)
In-Reply-To: <jmzne1y350.fsf@desire.geoffk.org>

On Tue, 2003-12-09 at 18:36, Geoff Keating wrote:
> Andrew MacLeod <amacleod@redhat.com> writes:
> 
> > Are we sure we want to GC between passes? :-|
> > 
> > since VDEFs and VUSEs are tree nodes, I can't allocate the structure
> > which holds them anywhere except GC'd memory can I?
> > 
> > ie
> > 
> > a_3 = VDEF <a_2>
> > 
> > This requires points to 2 trees.
> > 
> > the GC system has to know not to collect the trees I am pointing to in
> > the 2 words of the vdef vector.
> > 
> > but I dont want to GC the vdef vector.
> 

Here is my last remaining problem. I have a hack workaround, but I can't
bootstrap with it because of the warning I get.

The def and use structures contain a vector of tree pointers. This
vector is ggc_alloc()'d, but none of the elements in the vector ought to
be marked.
The problem is that gengtype will not allow me to have vevotrs of type
tree **. It says its an unknown type.

typedef struct def_optype_d GTY(())
{
  unsigned num_defs;
  tree ** defs;
} def_optype_t;


I've tried lots of things. If I use skip(""), then the vector itself
doesn't get collected.  I currently have a hack which works:

typedef struct def_optype_d GTY(())
{
  unsigned num_defs;
  tree * GTY((length("0"))) defs;
} def_optype_t;

and then cast 'defs' to a 'tree **' when it is used. THis performs
exactly what I want. defs get free'd and then no elements are touched
because the loop over the elements has an upper limit of 0, so nothing
happens. Bootstrap fails then because of the warning from the generated
file:

gtype-desc.c: In function `gt_ggc_mx_operands_d':

gtype-desc.c:78: warning: comparison of unsigned expression < 0 is always false
gtype-desc.c:85: warning: comparison of unsigned expression < 0 is always false
gtype-desc.c: In function `gt_pch_nx_operands_d':

if ((*x).def_ops.defs != NULL) {
        size_t i0;
        for (i0 = 0; i0 < (size_t)(0); i0++) {
          gt_ggc_m_9tree_node ((*x).def_ops.defs[i0]);
        }
        ggc_mark ((*x).def_ops.defs);
      }


So what am I suppose to do here? I've tried all the things I can think
of, and nothing seems to work exactly as I want.   How do I tell the
system that tree ** is simply a vector of things to ignore, just mark
the vector?

Andrew

  parent reply	other threads:[~2003-12-11 13:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-09 20:26 Andrew MacLeod
2003-12-09 23:43 ` Geoff Keating
2003-12-10  4:46   ` Andrew MacLeod
2003-12-11 17:01     ` Geoff Keating
2003-12-11 17:17       ` Andrew MacLeod
2003-12-11 21:15         ` Geoff Keating
2003-12-11 23:31           ` Andrew MacLeod
2003-12-15 22:05             ` Richard Henderson
2003-12-15 22:46               ` Andrew MacLeod
2003-12-11 19:30     ` law
2003-12-11 23:13       ` Andrew MacLeod
2003-12-12  0:21         ` law
2003-12-12  3:29           ` Andrew MacLeod
2003-12-12  5:24             ` law
2003-12-12 13:38               ` Andrew MacLeod
2003-12-13  6:52                 ` law
2003-12-11 14:17   ` Andrew MacLeod [this message]
2003-12-10  0:03 ` Jan Hubicka
2003-12-10  0:18   ` Andrew MacLeod
2003-12-10  0:38     ` Jan Hubicka
2003-12-11 19:30 ` law
2003-12-11 14:27 S. Bosscher
2003-12-11 14:34 ` Andrew MacLeod
2003-12-11 15:01   ` Andrew MacLeod

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=1071150789.10274.8.camel@p4 \
    --to=amacleod@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=geoffk@geoffk.org \
    /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).