Building jhc from darcs repo I get a compile error: src/FrontEnd/Class.hs:643:12: No instance for (Binary (Map.Map Name Class)) arising from a use of `get' at src/FrontEnd/Class.hs:643:12-26 Possible fix: add an instance declaration for (Binary (Map.Map Name Class)) In a stmt of a 'do' expression: an <- get In the expression: do { ah <- get; ai <- get; aj <- get; ak <- get; .... } In a case alternative: 1 -> do { ah <- get; ai <- get; aj <- get; .... } ghc version is 6.12.3 DrIFT Version is 2.2.3 ----------------------------------------
From: john@repetae.net Date: Wed, 29 Dec 2010 17:22:55 -0800 Subject: Re: [jhc] foreign ptr bugs To: korcan_h@hotmail.com CC: jhc@haskell.org
On Wed, Dec 29, 2010 at 4:45 PM, Korcan Hussein wrote:
Hi I mentioned this briefly in the past before, there is a bug when there are multiple foreign pointers in the same lexical scope obtained from (different) foreign binding functions. The pointer values end up having the same address this typically happens when GCC optimizations are enabled for which most of the time I can make code work correctly by adding -fdebug option to jhc.
Hmm... that is strange. I am actually working on the foreign pointer implementation at the moment in order to get them to play nicely with the new garbage collector. I'll have to see if I can reproduce this bug.
Another problem I've been having is erroneous C code generated with the same test code when I set the flag "-fno-global-optimize".
Hmm.. I have not tested that flag in a while, I'll check if it still should work and add it to the regression tests if it is something I intend to support going forward.
I'm using fedora, jhc-0.7.6
Have you tried with the latest darcs version of jhc? I fixed a couple bugs in the code generator, I don't think any would be causing this directly, but it is possible.
John