Opened 8 years ago

Closed 8 years ago

Last modified 6 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: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

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 8 years ago by stefan@…

  • Component changed from Compiler (Type checker) to Compiler
  • Keywords code generation added; type checker removed
  • Priority changed from low to normal

comment:2 Changed 8 years ago by guest

  • Summary changed from Type checker loops on Morris-style fixed-point operator to Compiler loops indefinitely on Morris-style fixed-point operator

comment:3 Changed 8 years ago by simonmar

  • Architecture changed from powerpc to Multiple
  • Operating System changed from MacOS X to Multiple
  • Resolution set to wontfix
  • Status changed from new to closed

This is a known bug, documented here.

comment:4 Changed 6 years ago by simonmar

  • Architecture changed from Multiple to Unknown/Multiple

comment:5 Changed 6 years ago by simonmar

  • Operating System changed from Multiple to Unknown/Multiple
Note: See TracTickets for help on using tickets.