This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Common Tail Elimination
- From: "Ramana Radhakrishnan" <ramana dot radhakrishnan at codito dot com>
- To: "Perry Smith" <pedz at easesoftware dot net>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 23 Mar 2006 23:54:21 +0530 (IST)
- Subject: Re: Common Tail Elimination
- References: <E1B709C1-1960-4E79-A420-0B931C4607FD@easesoftware.net>
- Reply-to: ramana dot radhakrishnan at codito dot com
This is called code sinking and AFAIK this is implemented in the 4.x
series. You can also look at the code factoring branch that was being
merged into 4.2.
> Does gcc/g++ have what I think is called "common tail elimination"?
> If a function does: step a, step b, step c, return val; in more than
> one place, will the common code be pulled out and branched to in
> order to reduce the size of the code? This may be contrary to most
> optimizations since it introduces a branch which costs time but the
> benefit is smaller code size.
>
> Thanks,
> Perry
>
----
Ramana Radhakrishnan
GNU Tools
Codito Technologies