jhc vs ghc and the surprising result involving ghc generated assembly.

Florian Weimer fw at deneb.enyo.de
Tue Nov 1 11:30:55 EST 2005


* John Meacham:

> loop:
>
> if () goto loop;
>
> is not equivalent to a do-while loop, loop invarients cannot be hoisted out of
> the above for instance (except in some cases... it is all quite tricky and we
> want gcc to have as much freedom as possible).

do-while loops are converted to this form by the compiler (as of
version 4, use the -fdump-tree-* to see the IL), so the problems you
are observing must be caused by something different.

> use C control constructs rather than gotos.

With GCC version 4, this will have no effect because the gimplifier
converts everything to goto-style anyway.


More information about the Glasgow-haskell-users mailing list