inside the GHC code generator

Claus Reinke claus.reinke at
Thu Feb 23 12:56:57 EST 2006

> the long answer is: are you ever heard promises that gcc is best
> cpu-independent assembler? no? and you know why? because gcc is not
> cpu-independent assembler. gcc was strongly optimized to make
> efficient asm from the code usually written by the C programmers. but
> code generated by ghc has nothing common with it. so we are stay with
> all these register-memory moves, non-unrolled loops and all other
> results of naive compilation. gcc is just don't know how to
> efficiently manage such code!

would there be any advantage to targetting gcc's backend directly?

I notice that Mercury seems to support this:

that is, does using C as assembler disable possible optimizations,
or is going through the C frontend enabling more optimizations than
going to the backend directly?

just curious,

More information about the Glasgow-haskell-users mailing list