[GHC] #10870: PPC.Ppr: Shift by 32 bits is not allowed.

GHC ghc-devs at haskell.org
Fri Sep 11 20:03:25 UTC 2015


#10870: PPC.Ppr: Shift by 32 bits is not allowed.
-------------------------------------+-------------------------------------
              Reporter:  nomeata     |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.10.2
  (CodeGen)                          |
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:  powerpc     |   Type of failure:  None/Unknown
             Test Case:              |        Blocked By:
              Blocking:              |   Related Tickets:
Differential Revisions:              |
-------------------------------------+-------------------------------------
 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.

 Is the code at fault, or the compiler?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10870>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list