This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa][ GC, Virtual operands, and GCing between passes


On Thu, 2003-12-11 at 22:58, law@redhat.com wrote:
> In message <1071199658.5712.571.camel@p4>, Andrew MacLeod writes:
>  >If it was just tree *def, we would have access to read the defs and
>  >uses, but if we wanted to actually change the value of the def or use
>  >operands in the originating stmt, you dont have a handle on the pointer
>  >in the stmt which points at that operand, so you cant change it without
>  >structure copying the tree structure.And we dont want to do that :-)
>  >tree **def lets us get a tthe things which points at the operand.
> Then how did it work previously with use_ops & def_ops?  I'm pretty sure
> we can replace uses & defs within that framework and my recollection was
> that it simply used a varray of tree *.
> 

Yessssssss....  

a varray of tree *... what is the data structure at the end of the
varray_type structure for a TREE_PTR varray?

tree *tp[1]

which is the same type as  my tree **tp, except its an in place array
instead of a dynamically allocated array.

It worked before because its a variable sized array at the end of the
varray structure, and doesnt have to have its elements marked.
so it would be sized as 

SIZEOF VARRAY_HDR + sizeof (tree *) * num_elements

and  the head of the varray is marked, and everything is wonderful.

I am using exactly the same representation, except Im trying to
dynamically allocate the array insead of having the overhead of the
varray structure.

I havent actually changed anything.

I could probably make it work with GC by declaring it as 

struct def_vector GTY(()) {
  tree * GTY((skip(""))) defs[1];
}

struct def_optype GTY(()) {
  size_y num_defs;
  struct def_vector *defs;
}

and then sizing it appropriately when malloced, but again, Im going
through contortions to make it work, My pointer to this structure will
in effect be a tree ** even though it will only be declared as a struct
'def_vector *'

I suppose I could even do it exactly the same as a varray:
struct def_optype GTY(()) {
  size_y num_defs;
  tree *def[1];
}

and size that one when malloced, except at the moment this structure
isnt malloced.

I may indeed contemplate doing that in fact, but it still doesnt change
the type of the def vector... 

Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]