This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Contributing tree-ssa to mainline
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: law at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 19 Jan 04 11:14:28 EST
- Subject: Re: [RFC] Contributing tree-ssa to mainline
But I wouldn't suggest tracking dataflow in the front-end solely for
the case of optimization purpose, particularly for things like bounds
checking since we really need to be doing that in language independent
ways given that every language can and should be making use of those
optimizers.
We mostly agree, but I maintain that there will always be some
language-dependent optimizations that need to be done in the front end that
will use such information.
For example, there are numerous cases in Ada where the presence of a certain
construct within a block means the block has to be "wrapped" in some way.
Whether that happens may depend on whether some bounds are variable or
constant or whether or not the construct in question is in dead code or not.
It can be very hard to express to language-independent parts of the compiler
what to "undo" and under what conditions (the variable vs. constant bound
information for some types of data structures are a good example here).
Adding relatively simple constant-propagation code to the front end caught a
lot of these cases and was therefore a worthwhile thing to do, despite
possible duplication with later passes. Simple static value range
determination code is another example as is simple dead-code elimination.
Then there's the point that Robert made: you often want to give warnings for
dead code or unused variables and the more language-specific those warning
are, the more use they'll be to the programmer.