Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#668 closed bug (wontfix)

Compiler loops indefinitely on Morris-style fixed-point operator

Reported by: Stefan Holdermans (stefan@… Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.4.1
Keywords: code generation, morris-style fixed-point operator Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Consider the following programs:

-- program 1.hs
newtype F a = F {unF :: F a -> a}
fix f       = (\x -> f (unF x x)) (F (\x -> f (unF x x)))
fac         = fix (\f -> \n -> if n == 0 then 1 else n * f (n - 1))
main        = return ()
-- program 2: morris2.hs
newtype F a = F {unF :: F a -> a}
fix f       = (\x -> f (unF x x)) (F (\x -> f (unF x x)))
fac         = fix (\f -> \n -> if n == 0 then 1 else n * f (n - 1))
main        = print (fac 2)

The first one compiles just fine; the second however causes GHC to go in an infinite loop:

$ ghc -c morris1.hs
$
$ ghc -c morris2.hs
(loops)

Change History (5)

comment:1 Changed 11 years ago by stefan@…

Component: Compiler (Type checker)Compiler
Keywords: code generation added; type checker removed
Priority: lownormal

comment:2 Changed 11 years ago by guest

Summary: Type checker loops on Morris-style fixed-point operatorCompiler loops indefinitely on Morris-style fixed-point operator

comment:3 Changed 11 years ago by simonmar

Architecture: powerpcMultiple
Operating System: MacOS XMultiple
Resolution: wontfix
Status: newclosed

This is a known bug, documented here.

comment:4 Changed 8 years ago by simonmar

Architecture: MultipleUnknown/Multiple

comment:5 Changed 8 years ago by simonmar

Operating System: MultipleUnknown/Multiple
Note: See TracTickets for help on using tickets.