[GHC] #7575: LLVM backend does not properly widen certain literal types in call expressions

GHC cvs-ghc at haskell.org
Sun Jan 13 12:07:11 CET 2013


#7575: LLVM backend does not properly widen certain literal types in call
expressions
-----------------------------+----------------------------------------------
Reporter:  thoughtpolice     |          Owner:                  
    Type:  bug               |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  7.6.1             |       Keywords:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
 Failure:  None/Unknown      |      Blockedby:                  
Blocking:                    |        Related:  #7571, #7574    
-----------------------------+----------------------------------------------
 Related to #7571 and #7574, while compiling stage2 with stage1 GHC HEAD on
 my ODROID, my build fails in ```libraries/base/GHC/Word.hs``` with:

 {{{
 linaro at linaro-ubuntu-desktop ~/code/ghc
  % "inplace/bin/ghc-stage1" -static  -H64m -O0 -fasm    -package-name
 base-4.7.0.0 -hide-all-packages -i -ilibraries/base/. -ilibrarie-
 Ilibraries/base/dist-install/build -Ilibraries/base/dist-
 install/build/autogen -Ilibraries/base/include   -optP-
 DOPTIMISE_INTEGER_GCDl_macros.h -package ghc-prim-0.3.1.0 -package
 integer-gmp-0.5.1.0 -package rts-1.0  -package-name base -XHaskell98 -XCPP
 -O -fasm  -no -hidir libraries/base/dist-install/build -stubdir
 libraries/base/dist-install/build -hisuf hi -osuf  o -hcsuf hc -c
 libraries/base/./files -tmpdir tmpdir

 when making flags consistent: Warning:
     No native code generator, so using LLVM
 You are using a new version of LLVM that hasn't been tested yet!
 We will try though...
 /home/linaro/bin/opt: tmpdir/ghc12774_0/ghc12774_0.ll:26765:62: error:
 argument is not of expected type 'i64'
   %lnhvj = call ccc i32 (i64,i64)* @hs_eqWord64( i64 %lnhvi, i32 0 )
 nounwind
 }}}

 The declaration of ```hs_eqWord64` is:

 {{{
 declare  ccc i32 @hs_eqWord64(i64, i64) align 4
 }}}

 And we get:

 {{{
 %lnhvj = call ccc i32 (i64,i64)* @hs_eqWord64( i64 %lnhvi, i32 0 )
 nounwind
 }}}

 inside of ```c8Aq_info```, which has a tail call from the symbol
 ```base_GHCziWord_zdfNumWord64zuzdcsignum_info``` or
 ```base_GHC.Word_$fNumWord64_$csignum_info``` - this would seem to be some
 specialized instance of the case:

 {{{
 instance Num Word64 where
     ...
     signum 0               = 0
     signum _               = 1
 }}}

 ... I think. This seems like a fairly simple fix similar to the others,
 but I'm filing it for now.

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



More information about the ghc-tickets mailing list