
Hello Simon, Tuesday, June 13, 2006, 2:18:42 PM, you wrote:
just small note for this page:
The code generated by GHC for a tail-recursive loop uses an explicit tail call for the recursion, which gcc cannot spot as a branch.
gcc can convert recursion into loop and even unroll it. my tests showed that gcc require that THE SAME VARIABLE used in recursion/loop in order to understand that it is indeed a loop. so, the following: while (i>0) { j=i; i=j-1; } will be not considered as loop and unrolled, while the following: a(int i) { if (i>0) a(i-1); } will be tail-recursed and then even unrolled
Basically we want to beef up the NCG and deprecate -fvia-C.
but it still will be used for unregisterised compilation? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com