PPC.Ppr: Shift by 32 bits is not allowed.
Hi,
when compiling vector-algorithms on powerpc, I get
[ 7 of 10] Compiling Data.Vector.Algorithms.Tim ( src/Data/Vector/Algorithms/Tim.hs, dist-ghc/build/Data/Vector/Algorithms/Tim.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.10.2 for powerpc-unknown-linux):
PPC.Ppr: Shift by 32 bits is not allowed.
I do not get this error on other 32bit architectures.
The offending code seems to be
minrun :: Int -> Int
minrun n0 = (n0 `unsafeShiftR` extra) + if (lowMask .&. n0) > 0 then 1 else 0
where
-- smear the bits down from the most significant bit
!n1 = n0 .|. unsafeShiftR n0 1
!n2 = n1 .|. unsafeShiftR n1 2
!n3 = n2 .|. unsafeShiftR n2 4
!n4 = n3 .|. unsafeShiftR n3 8
!n5 = n4 .|. unsafeShiftR n4 16
!n6 = n5 .|. unsafeShiftR n5 32
The call to panic was introduced by Erik in the fix for #5900 (closed).
Is the code at fault, or the compiler?
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.10.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (CodeGen) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | erikd |
| Operating system | |
| Architecture |