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]

Re: Recursion Optimization


Zack Weinberg wrote:
> 
> ... To answer the original question: No, GCC is not capable of any of these
> optimizations.  I'm sure we would be delighted to accept contributions
> that gave it the ability to do them.  Even adding support for general
> tail recursion optimization a la Scheme would be a great step
> forward.
> 
> There is existing support for tail recursion optimization in very
> limited cases.  I have never got it to do anything useful for non-toy
> functions.

Has anyone tried writing a front end for a functional language like ML
or even Haskell for gcc.  Since recursion is the heart and soul of
functional languages I am sure that these sort of optimizations will
also come with it.  I am not sure what type of issues are involved
though as a good functional compiler has to do a lot more than mere
recursion optimization--especially for languages like Haskell which are
not only functional but also lazy.

-- 
Kevin Atkinson
kevinatk@home.com
http://metalab.unc.edu/kevina/


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