This is the mail archive of the 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: [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

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.

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