This is the mail archive of the
mailing list for the GCC project.
Re: [LTO][PATCH] Fix ICE in output_tree.
2008/11/18 Diego Novillo <email@example.com>:
> 2008/11/18 Doug Kwan (???) <firstname.lastname@example.org>:
> Did you consider the idea of registering trees that need fixups
> during streaming? I haven't thought it through, so I'm not sure
> if it's really useful. For now, the important thing is to fix
> the bug.
Yes, I have another sandbox with a back-patching based fix but it is
not done. The problem, as I have mentioned earlier, is that we are
not registering trees, but rather pointer to trees. So for any fields
b->f = input_tree (...);
we have to check that if b->f is a global VAR_DECL or FUNC_DECL and
then stash &(b->f) away for later fixing up. Since the original code
in lto-function-in.c is not set up for back-patching, a change like
this could be very extensive and error-prone. In my sandbox, I have
a function lto_mark_xxx for each tree node type we care. I added a
call to lto_mark_tree to each of the input_xxx function and scan the
result for any back-patchable trees. It is not as efficient as
inter-leaving the code in there but I think it is more readable and
maintainable this way. It does require a little bit more time to get
it to work because I need to make sure all tree nodes read are marked
and gcc is not changing them nor stashing pointers to DECLs away
behind my back.
>> +static tree lto_fixup_tree (tree*, int*, void *);
> What about this?
> for (n = TREE_CHAIN (t); n; n = TREE_CHAIN (n))
> LTO_FIXUP_SUBTREE (n);
That is much better. Thanks.
> I prefer if we access the fields using the the DECL_* macros.
> I've been meaning to change this in the streamer for a while now,
> so I'd rather not generate new instances of this. We won't need
> explicit call to *_CHECK in that case.
Some field can be changed to access but not all. There are fields in
based types that are overloaded with only accessors in derived types.
For example, there is no accessor for type.minval. I can change the