[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Use pair as loop result handle in compiler
Re: [Chicken-hackers] [PATCH] Use pair as loop result handle in compiler-syntax for `map`
Mon, 21 Dec 2015 22:15:32 +0100
On Mon, Dec 21, 2015 at 04:25:04PM +1300, Evan Hanson wrote:
> Hi hackers,
> Here's a patch for an issue Felix pointed out way back in April, in
> <address@hidden> (the
> actual message is inline, below). I actually mentioned this a while ago
> and meant to bring it up for discussion at ICC, but it slipped my mind
> there and then sat neglected for a while.
Wow, that's a long time ago. Thanks for digging this up!
> Anyway, the patch addresses the extra CPS call described in that email,
> in the expansion of compiler syntax for `map`. The continuation in
> question is caused by a conditional in the body of the expansion's named
> let, and its presence prevents that loop from compiling down to a label
> and goto.
I've tested this, and it turns out the compiler _is_ able to generate a
loop in C even with the original code, but only when using -O2. With
the patch you posted, it's able to generate this with -O1 (the default
optimization level if you don't pass any -O options), so it's strictly
better code because the compiler can handle it more easily, I'd say.
Thanks for the patch, I've pushed it to both branches.
Description: Digital signature