#2080: Bug in CmmOpt
-------------------------+--------------------------------------------------
    Reporter:  simonmar  |       Owner:  simonmar
        Type:  bug       |      Status:  new     
    Priority:  normal    |   Milestone:  6.8.3   
   Component:  Compiler  |     Version:  6.8.2   
    Severity:  normal    |    Keywords:          
  Difficulty:  Unknown   |    Testcase:          
Architecture:  Unknown   |          Os:  Unknown 
-------------------------+--------------------------------------------------
 Two bugs are demonstrated by the following code.  The first one is wrong
 code generated for the comparison, and the second is the panic (see the
 comment):

 {{{
 module Test where
 import GHC.Base

 utf8DecodeChar# :: Addr# -> Bool -> Bool
 {-# NOINLINE utf8DecodeChar# #-}
 utf8DecodeChar# a# fred =
   case () of
     _ | word2Int# (indexWord8OffAddr# a# 0#) <=# 0x7F# -> True

 -- Omitting the next line gives an ASSERT error:
 -- ghc-6.9: panic! (the 'impossible' happened)
 --   (GHC version 6.9 for x86_64-unknown-linux):
 --      ASSERT failed! file nativeGen/MachCodeGen.hs line 1049
 -- %MO_S_Le_I8(I8[R2], 127 :: I8)
       | fred -> True

       | otherwise -> False
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2080>
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

Reply via email to