#5550: GHC infinite loop when compiling vector
---------------------------------+------------------------------------------
Reporter: simonpj | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.4.1
Component: Compiler | Version: 7.2.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by rl):
How about a very simple heuristic. When we find a specialisation, we look
at each argument separately and turn on the "must be scrutinised" check
for it if we find duplicate nested constructors. By this, I mean that the
argument contains a subterm `C @t1 ... @tm x1 ... xn` where `C` is a
constructor and one of `x1 ... xn` contains a subterm `C @t1 ... @tm y1
... yn` which uses the same constructor at the same types. So with my
example, when we get to `loop SPEC (x:y:z) xs` we would spot `x:y:z` and
turn on the "must be scrutinised" check for this argument. But in `foo
SPEC (x,(y,z))`, the nested tuple constructors would have different types
and wouldn't trigger this.
Having written this down, I realise that this might not be all that simple
to implement. But it does seem to avoid loops and doesn't rely on checking
for recursive types.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5550#comment:18>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs