This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix type correctness of fold_indirect_ref
On Tuesday 17 May 2005 02:15, Mark Mitchell wrote:
> Steven Bosscher wrote:
> >>That's orthogonal. There's no reason you can't write a great front end
> >>using trees.
> >
> > But it is hard to write a great back end using trees when at least one
> > front end has its own set of rules about using trees.
>
> No, that's not true either. It's hard to write a great back end when
> you try to interleave the front end and the back end. If the front end
> works for a while, stops, and hands some well-defined data structures to
> the back end in the format the back end wants, there's no problem.
You forget that we drag around all the language specific extensions to
trees as well. Things lang_identifier, lang_decl, and lang_type are a
major pain. Do you have any idea how large a simple scalar temporary
is in the tree optimizers for G++? Our struct tree_decl is already not
exactly a fine example of lean and mean, but lang_decl and (especially)
lang_identifier make it a real pain. (I'm aware that making DECL_*NAME
strings would fix this, it's a major project we should list somewhere).
> > G++ also needs to define a lot of language-specific tree nodes because
> > it wants a representation that is close to the source code.
>
> I think that's a bit of a stretch. In theory, we could always have just
> one tree code for CXX_TREE and then some other discriminator. The truth
> is that if we made the things that need not be trees not be trees, there
> wouldn't be very many C++-specific tree codes.
But you would still have pointers from trees to non-trees, and the other
way around. E.g. do you think OVERLOAD should be a tree?
Gr.
Steven