#4090: Impossible compilation with primitive operations (possibly unsafeCoerce#)
------------------------+---------------------------------------------------
    Reporter:  malosh   |       Owner:                    
        Type:  bug      |      Status:  new               
    Priority:  normal   |   Component:  Compiler          
     Version:  6.12.1   |    Keywords:                    
          Os:  MacOS X  |    Testcase:                    
Architecture:  x86      |     Failure:  Compile-time crash
------------------------+---------------------------------------------------

Comment(by malosh):

 The code is :
 {{{
 ulp#::Double#->Double#
 ulp# d=
    let w=unsafeCoerce# d :: Word64#
        e=(unsafeCoerce# (uncheckedShiftRL64# w 52#)) `and#` 0x7ff##
    in
     if e `gtWord#` 0x034## then
       unsafeCoerce# (unsafeCoerce# (e `minusWord#` (0x034##))
 `uncheckedShiftL64#` 52#)
     else
       unsafeCoerce# (1## `uncheckedShiftL#` ((unsafeCoerce# e) -# 1#))
 }}}

 And the compiler answers :

 {{{
 GHC 6.12.1 returns :

 ghc: panic! (the 'impossible' happened)
   (GHC version 6.12.1 for i386-apple-darwin):
         getRegister(x86) I64[BaseReg + 72]
 }}}

 (Sorry for the wrong trac formatting).

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