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: An issue for the SC: horrible documentation quality of GCC


Hello,

> Zdenek> The sane way
> Zdenek> how to write a compiler is to run these generic passes first, then
> Zdenek> run machine-dependent passes that may eventually fix the mistakes
> Zdenek> the previous optimizations have done (due to their generic ideas being
> Zdenek> not right in some corner cases). This way we would get approximately
> Zdenek> the same results, but in much more transparent way.
> 
> 	This assumes that the mistakes can be corrected with a later
> machine-dependent pass, which is not always correct.  Plus it takes more
> compile time to correct the mistakes instead of choosing the correct
> heuristics in the first place.

I guess that for every such heuristic you will with some care find an
example where it does a stupidity. In general it makes more sense to
have a few passes with really good heuristics than have some lame
heuristic in every pass.

As for the speed -- I guess this is just a matter of opinion, as there
is nothing to compare. My opinion is that the increased speed of most of the
passes would pay up for the decreased speed of a few cleanup passes
(they must be in some form present anyway, they already must gather all
the data, so the slowdown should not be that dramatic).

> The generic pass already needs to apply *some* heuristic.

this is of course true; but it should target the most obvious ones and
do not try to solve every corner case at every optimization.

Zdenek


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