#952: Floating point exception building HEAD with 6.6
-------------------------------+--------------------------------------------
Reporter: simonmar | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 6.6.1
Component: Compiler | Version: 6.6
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: x86_64 (amd64) | Os: Linux
-------------------------------+--------------------------------------------
I get a floating point exception building HEAD with 6.6. I tracked it
down to `getCommonNodeUFMData` in `UniqFM`:
{{{
getCommonNodeUFMData :: NodeUFMData -> NodeUFMData -> NodeUFMData
getCommonNodeUFMData (NodeUFMData i p) (NodeUFMData i2 p2)
| p ==# p2 = getCommonNodeUFMData_ p j j2
| p <# p2 = getCommonNodeUFMData_ p2 (j `quotFastInt` (p2
`quotFastInt` p)) j2
| otherwise = getCommonNodeUFMData_ p j (j2 `quotFastInt` (p
`quotFastInt` p2))
where
l = (_ILIT(1) :: FastInt)
j = i `quotFastInt` (p `shiftL_` l)
j2 = i2 `quotFastInt` (p2 `shiftL_` l)
getCommonNodeUFMData_ :: FastInt -> FastInt -> FastInt -> NodeUFMData
getCommonNodeUFMData_ p j j_
| j ==# j_
= NodeUFMData (((j `shiftL_` l) +# l) *# p) p
| otherwise
= getCommonNodeUFMData_ (p `shiftL_` l) (j `shiftR_` l) (j_
`shiftR_` l)
}}}
The division `j2` is a divide-by-zero; `p2` is zero.
Compiling `UniqFM` with `DEBUG` makes it go away. Compiling with `-fasm`
has no effect, so it isn't dependent on the back-end.
This may be architecture-specific; I've only seen it on x86_64 so far.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/952>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs