
Hello, On Saturday 24 February 2007 19:28, Neil Mitchell wrote:
...
I've just added some code so it now reads:
case (local,res) of ([x], _) -> return x (_, [x]) -> return x ([], []) -> raiseError $ ErrorFileNone noErrPos askMsg file rs (as, bs) -> -- ASSERTION TO DEBUG GHC 6.6 WITHOUT -O CODEGEN ON A MAC! assert (not $ null $ as ++ bs) $ raiseError $ ErrorFileMany noErrPos askMsg file (map anyOne (as ++ bs))
That (to me) looks like an assertion that should always be true, but which appears at first glance to be being violated by GHC 6.6 on a Mac when compiled without -O. Can you try that on your machine, and see if it does raise an assertion? If it does, we can then contact the GHC developers and let them get a minimal test case :) ...
To clarify: The yhc failure (i.e. erroneously reporting "multiple files found" instead of "no files found") occurs when yhc has been built with "scons build yhc type=release" so that Package.hs is compiled by ghc-6.6 with -O option. If I compile Package.hs without type=release (i.e. "scons build yhc" which then recompiles a lot, (all?) including Package.hs) so that Package.hs and the other .hs files are compiled without ghc-6.6 option -O, then the resulting yhc works, i.e. reports "no files found" as it should. So: Compiled with type=release (and therefore ghc-6.6 -O), yhc fails. And compiled without type=release (and therefore ghc-6.6 without -O) yhc works. And further: I have tried the above on my machine. Unfortunately, the bug (erroneous report) now disappears, i.e. after scons build yhc type=release, yhc correctly reports "not files found". And, if I remove the assert that you have inserted, the bug re-appears, i.e. yhc incorrectly reports "multiple files" when there are, in fact, none. Neat, eh? I am now trying to introduce the assert in Error.hs instead, don't know if this is a good idea. But in any case, I have the additional problem that (according to ghc documentation), -O (which we need to see the error) implies -fignore-asserts. So I am trying now with GHCFLAGS=-fno-ignore-asserts scons ... Best regards Thorkil

Hi
So: Compiled with type=release (and therefore ghc-6.6 -O), yhc fails. And compiled without type=release (and therefore ghc-6.6 without -O) yhc works.
Ok, I'll try this once more with both configurations and see what I get. I don't think I tried type=release with 6.6
And further: I have tried the above on my machine. Unfortunately, the bug (erroneous report) now disappears, i.e. after scons build yhc type=release, yhc correctly reports "not files found". And, if I remove the assert that you have inserted, the bug re-appears, i.e. yhc incorrectly reports "multiple files" when there are, in fact, none.
Lovely, so the compiler is changing the behaviour based on the assert call...
I am now trying to introduce the assert in Error.hs instead, don't know if this is a good idea. But in any case, I have the additional problem that (according to ghc documentation), -O (which we need to see the error) implies -fignore-asserts. So I am trying now with GHCFLAGS=-fno-ignore-asserts scons ...
I've added a patch to use a hand coded assert which -fignore-asserts won't take away. Thanks Neil

Hi
So: Compiled with type=release (and therefore ghc-6.6 -O), yhc fails. And compiled without type=release (and therefore ghc-6.6 without -O) yhc works.
I can now replicate these results exactly. I therefore declare this to be a GHC bug, and will raise the issue on the GHC mailing list. The assert does indeed stop the bug happening, and I've added a call to error in Errors.hs if this situation is detected. Thanks for all your efforts in tracking this down! Neil
participants (2)
-
Neil Mitchell
-
Thorkil Naur