Ticket #7575 (closed bug: fixed)
LLVM backend does not properly widen certain literal types in call expressions
| Reported by: | thoughtpolice | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Compiler (LLVM) | Version: | 7.7 |
| Keywords: | llvm, codegen | Cc: | dterei, simonmar, mad.one@…, bgamari@…, nathan.huesken@… |
| Operating System: | Linux | Architecture: | arm |
| Type of failure: | Compile-time crash | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | #7589 | Related Tickets: | #7571, #7574 |
Description
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@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.
Change History
Note: See
TracTickets for help on using
tickets.
