$ cat bug.hs bla = (if True then (+) else (+)) 0 0 $ hugs bug.hs __ __ __ __ ____ ___ _________________________________________ || || || || || || ||__ Hugs 98: Based on the Haskell 98 standard ||___|| ||__|| ||__|| __|| Copyright (c) 1994-2003 ||---|| ___|| World Wide Web: http://haskell.org/hugs || || Report bugs to: hugs-bugs@haskell.org || || Version: November 2003 _________________________________________ Haskell 98 mode: Restart with command line option -98 to enable extensions Type :? for help Main> bla primPlusInteger Main> bla+0 INTERNAL ERROR: Bignum expected Main>
On Fri, Oct 22, 2004 at 07:45:32AM +0000, fool@sdf-eu.org wrote:
bla = (if True then (+) else (+)) 0 0
An elegant report. Here's another version: bla = (if True then id else negate) (1::Int) Unfortunately it seems to point at a whole class of longstanding bugs in the peephole optimizer: it takes no account of branch targets. (Here MKAP 1; MKAP 1 => MKAP 2, but the second MKAP was the target of a TEST branch.) Another of these optimizations was turned off two years ago for a similar reason, but they all seem similarly flawed.
participants (2)
-
fool@sdf-eu.org -
Ross Paterson