On Tue, May 1, 2012 at 3:05 AM, Simon Marlow <[email protected]> wrote:

> commit 832fa64008548c6be4190da0a79a2b6e339eb7bd
> Author: Simon Marlow <[email protected]>
> Date:   Mon Apr 30 12:26:49 2012 +0100
>
>    Fix capi_value on Windows
>
>    This appears to be a bug in the gcc that we're currently using.
>
>    Compiling this, with -O:
>
>    const int i;
>    int f(void) {return i;}
>
>    results in this assembly:
>
>            pushl   %ebp
>            movl    %esp, %ebp
>            movl    $0, %eax   <--- the $0 is wrong, should be _i
>            leave
>            ret
>
>    Turning off -O makes it work.
>
>    Maybe time to update our mingw gcc bundles?

yes, it is a bug in that version of GCC/gcc.  Does explicit use of 'extern'
makes the bug go away? E.g.

    extern const int i;

(that should be semantically equivalent to the original program.)

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to