This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Work in progress: "Super Sib Calls"; opinions sought
- From: Jeff Law <law at porcupine dot slc dot redhat dot com>
- To: Jason Ozolins <jason dot ozolins at anu dot edu dot au>
- Cc: Simon Marlow <simonmar at microsoft dot com>, gcc at gcc dot gnu dot org, pizka at in dot tum dot de
- Date: Tue, 10 Sep 2002 11:09:17 -0600
- Subject: Re: Work in progress: "Super Sib Calls"; opinions sought
- Reply-to: law at redhat dot com
In message <3D7D5B94.63674DC3@anu.edu.au>, Jason Ozolins writes:
>Simon Marlow wrote:
>Doing the dependency analysis would be great, but it strikes me that if
>it were easy, someone would probably already have done it. :-)
I believe a number of compilers have done this -- mostly to minimize
argument register copying for functions which shuffle their incoming
arguments and pass them down to another function.
>perfect, what's wrong with an effort to make tail-calls work with
>overlapping arguments in a way that is easier to verify correctness,
>leaving open the option to do the dependency analysis as an optimization
>later on?
Because it's the dependency analysis that you use to actually verify
correctness. That's really the best way to solve the correctness problem.
Once you have the dependency analysis to solve the correctness problem,
optimizing away the unwanted copies is relatively easy.
I strongly suspect if you sit down and try to write code to get the
overlapping argument problem correct that you'll find that dependency
analysis is the natural answer.
jeff