ghc 8.4.1 and trac 13930

Ben Gamari ben at smart-cactus.org
Wed May 2 04:58:21 UTC 2018


Evan Laforge <qdunkan at gmail.com> writes:

> I recently noticed that with -O1, ghc was optimizing some code
>
>     if Trace.traceShowId "b" $ True
>         then return $ Left $ Serialize.BadMagic (Serialize.magicBytes
> magic) file_magic
>         else first Serialize.UnserializeError <$> Exception.evaluate
> (Serialize.decode rest)
>
> to always evaluate the 'else' branch.  This is fixed in 8.4.2, so I'm
> pretty sure it's https://ghc.haskell.org/trac/ghc/ticket/13930
>
> I assume there's no point trying to get a minimal reproduction, since
> it's a known issue and fixed.  Still,
> https://downloads.haskell.org/~ghc/8.4.2/docs/html/users_guide/8.4.2-notes.html
> says "incorrectly optimised, resulting in space leaks".
>
> Maybe it should instead say "incorrectly optimised, resulting in
> taking the wrong branch in 'if' expressions"?  That's a bit more
> alarming, and is a stronger "upgrade to 8.4.2" signal.

Yes, I suppose the language in the release notes does rather understate
the degree of the incorrectness.

I'll push a new version of the manual with some stronger language
tomorrow.

Cheers,

- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20180502/05ff5136/attachment.sig>


More information about the ghc-devs mailing list