id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
952,gcc should be passed the -fwrapv flag,simonmar,igloo,"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.",merge,closed,normal,6.6.1,Compiler,6.6,fixed,,,Unknown/Multiple,Unknown/Multiple,,Unknown,,,,
