This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54770] sibling call optimization is not applied where it ought to be
- From: "andy.m.jost at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 02 Oct 2012 15:25:46 +0000
- Subject: [Bug c++/54770] sibling call optimization is not applied where it ought to be
- Auto-submitted: auto-generated
- References: <bug-54770-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54770
--- Comment #5 from Andy Jost <andy.m.jost at gmail dot com> 2012-10-02 15:25:46 UTC ---
Most of the technical discussion is over my head, I'm afraid. Is there a
simple workaround? What if the body of H contains only a call to a
non-inlineable function to do its work and then the recursive call back to H?
For those of us using GCC to compile a functional language, tail recursion is a
requirement. We either need to make sure the compiler uses it every time, or
resort to more manual methods. The option to specify a required sibling call
would be ideal (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52067).