
I expected something like that. I'm all the way back in ghc-8.2.2, but I
think what this really shows is that the flag is unreliable and
version-dependent. Unfortunately there doesn't seem to be a precise
specification of where yield points should appear, and therefore, where
they might be not-omitted.
On Wed, Nov 28, 2018, 17:10 Viktor Dukhovni On Wed, Nov 28, 2018 at 09:39:01AM -0800, Ryan Reich wrote: Thanks for the suggestion, which Arjen made also. Unfortunately, it does
not appear to help. See this simple program: -- Loop.hs
import Control.Exception
import System.Timeout main :: IO (Maybe Integer)
main = timeout 100000 $ evaluate $ last $ repeat 0
-- end With either GHC invocation "stack exec ghc Loop[ -- -fno-omit-yields]",
running ./Loop fails to terminate (it should do so in 0.1s). Based only on the very terse description of that flag in the User's
Guide,
and its name, I think the problem is simply that GHC doesn't normally
*generate* yields in that loop, so there's nothing not to omit. It times out for me with GHC 8.4.4 on FreeBSD 11.2, and "ghc -O
-fno-omit-yields"
and does not time out with "ghc -O": $ cat /tmp/foo.hs
import Control.Exception
import System.Timeout main :: IO (Maybe Integer)
main = timeout 1000000 $ evaluate $ last $ repeat 0 $ ghc -O -fno-omit-yields /tmp/foo.hs
[1 of 1] Compiling Main ( /tmp/foo.hs, /tmp/foo.o )
[Optimisation flags changed]
Linking /tmp/foo ... $ time /tmp/foo real 0m1.033s
user 0m1.025s
sys 0m0.008s $ rm /tmp/foo
$ ghc -O /tmp/foo.hs
[1 of 1] Compiling Main ( /tmp/foo.hs, /tmp/foo.o )
[Optimisation flags changed]
Linking /tmp/foo ... $ time /tmp/foo
^C^C real 0m5.864s
user 0m5.857s
sys 0m0.000s On MacOS X with GHC 7.10.3, it does not time out either way. Perhaps
some versions of GHC don't make the timeout possible. --
Viktor.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.