<div dir="ltr"><div><div><div>Ok, so I found that it was an instance of this: <a href="https://ghc.haskell.org/trac/ghc/ticket/1168">https://ghc.haskell.org/trac/ghc/ticket/1168</a><br></div>and I read through this whole thread: <a href="https://www.haskell.org/pipermail/glasgow-haskell-users/2008-February/014259.html">https://www.haskell.org/pipermail/glasgow-haskell-users/2008-February/014259.html</a><br><br></div>I don't understand the state-hack optimization.  It's clearly not safe and I'm not convinced that it actually is an optimization.  In what circumstances does the state-hack identify a single-entry function that can't be identified as single-entry by some other (safe) method?<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 7, 2014 at 10:52 AM, David Spies <span dir="ltr"><<a href="mailto:dnspies@gmail.com" target="_blank">dnspies@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I have a program I wrote to submit for the Car Game problem on Kattis: <a href="https://open.kattis.com/problems/cargame" target="_blank">https://open.kattis.com/problems/cargame</a><br></div><div>but it runs over the 5-second time-limit<br></div><div><br></div>I downloaded the test data and found that on GHC 7.8.3, if I switch from -O2 to -O0, it runs three times faster (almost certainly fast enough for Kattis to accept).  Can someone tell me what's going on?  Is this a bug?<br><br></div>
</blockquote></div><br></div>