Re: internal error

Ross Paterson <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <[email protected]>
On Fri, Oct 22, 2004 at 07:45:32AM +0000, [email protected] 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.