[GHC] #7598: ghc-stage1 generates wrong assembler on StgCmmPrim (operand out of range)

#7598: ghc-stage1 generates wrong assembler on StgCmmPrim (operand out of range) --------------------------------+------------------------------------------- Reporter: kgardas | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Linux | Architecture: powerpc Failure: Building GHC failed | Blockedby: Blocking: | Related: --------------------------------+------------------------------------------- Hello, an attempt to compile today GHC HEAD on linux powerpc fails with this message {{{ "inplace/bin/ghc-stage1" -static -H32m -O -package-name ghc-7.7.20130115 -hide-all-packages -i -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/vectorise -icompiler/stage2/build -icompiler/stage2/build/autogen -Icompiler/stage2/build -Icompiler/stage2/build/autogen -Icompiler/../rts/dist/build -Icompiler/stage2 -Icompiler/. -Icompiler/parser -Icompiler/utils -optP- DGHCI -optP-include -optPcompiler/stage2/build/autogen/cabal_macros.h -package Cabal-1.17.0 -package array-0.4.0.2 -package base-4.7.0.0 -package bin-package-db-0.0.0.0 -package bytestring-0.10.3.0 -package containers-0.5.0.0 -package directory-1.2.0.1 -package filepath-1.3.0.2 -package hoopl-3.10.0.0 -package hpc-0.6.0.1 -package process-1.2.0.0 -package template-haskell-2.9.0.0 -package time-1.4.0.2 -package transformers-0.3.0.0 -package unix-2.6.1.0 -Wall -fno-warn-name-shadowing -XHaskell98 -XNondecreasingIndentation -XCPP -XMagicHash -XUnboxedTuples -XPatternGuards -XForeignFunctionInterface -XEmptyDataDecls -XTypeSynonymInstances -XMultiParamTypeClasses -XFlexibleInstances -XRankNTypes -XScopedTypeVariables -XDeriveDataTypeable -XBangPatterns -DGHCI_TABLES_NEXT_TO_CODE -DSTAGE=2 -O2 -no-user-package-db -rtsopts -odir compiler/stage2/build -hidir compiler/stage2/build -stubdir compiler/stage2/build -hisuf hi -osuf o -hcsuf hc -c compiler/codeGen/StgCmmPrim.hs -o compiler/stage2/build/StgCmmPrim.o /tmp/ghc20445_0/ghc20445_0.s: Assembler messages: /tmp/ghc20445_0/ghc20445_0.s:98896:0: Error: operand out of range (0x00000000000081ac is not between 0xffffffffffff8000 and 0x0000000000007ffc) make[1]: *** [compiler/stage2/build/StgCmmPrim.o] Error 1 make: *** [all] Error 2 }}} The platform is 32bit PowerPC running debian wheezy which provides GHC 7.4.1 used for bootstrapping GHC HEAD. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7598 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7598: ghc-stage1 generates wrong assembler on StgCmmPrim (operand out of range) --------------------------------+------------------------------------------- Reporter: kgardas | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Linux | Architecture: powerpc Failure: Building GHC failed | Blockedby: Blocking: | Related: --------------------------------+------------------------------------------- Comment(by kgardas): if assembler correctly reports line number, then this should be this: {{{ 98877 .text 98878 .align 2 98879 .long uVbd_srtd-(cN2c_info)+0 98880 .long 4 98881 .long 2162687 98882 cN2c_info: 98883 .LcN2c: 98884 mr 31, 14 98885 andi. 30, 31, 3 98886 cmplwi 30, 2 98887 blt $+8 98888 b .LcNoE 98889 .LcNoD: 98890 lis 31, cNdK_info@ha 98891 addi 31, 31, cNdK_info@l 98892 stw 31, 0(22) 98893 lwz 14, 4(22) 98894 andi. 31, 14, 3 98895 cmpwi 31, 0 ->98896 bne .LcNdK 98897 .LcOgw: 98898 lwz 31, 0(14) 98899 mtctr 31 98900 bctr }}} am I right assuming we're generating jump and it's too long for PPC to perform? i.e. bne is conditional branch instruction which should jump just in a range of 16K. Full assembler file generated attached for your convenient. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7598#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7598: ghc-stage1 generates wrong assembler on StgCmmPrim (operand out of range) --------------------------------+------------------------------------------- Reporter: kgardas | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Linux | Architecture: powerpc Failure: Building GHC failed | Blockedby: Blocking: | Related: --------------------------------+------------------------------------------- Changes (by PHO): * cc: pho@… (added) Comment: Perhaps duplicate of #709? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7598#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7598: ghc-stage1 generates wrong assembler on StgCmmPrim (operand out of range) --------------------------------+------------------------------------------- Reporter: kgardas | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Linux | Architecture: powerpc Failure: Building GHC failed | Blockedby: Blocking: | Related: --------------------------------+------------------------------------------- Comment(by kgardas): Yes, this is indeed the same issue. In fact my workaround for this and my testing if I'm right is to turn all BCC isns into BCCFAR in genCondJump and viola I've been able to build HEAD on my 32bit PPC board. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7598#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7598: ghc-stage1 generates wrong assembler on StgCmmPrim (operand out of range) -------------------------+-------------------------------------------------- Reporter: kgardas | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.7 Keywords: | Os: Linux Architecture: powerpc | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -------------------------+-------------------------------------------------- Changes (by igloo): * priority: normal => high * difficulty: => Unknown * milestone: => 7.8.1 Comment: #709 is closed, so is this also fixed now? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7598#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7598: ghc-stage1 generates wrong assembler on StgCmmPrim (operand out of range) -------------------------+-------------------------------------------------- Reporter: kgardas | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.7 Keywords: | Os: Linux Architecture: powerpc | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -------------------------+-------------------------------------------------- Comment(by igloo): See also #7830 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7598#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7598: ghc-stage1 generates wrong assembler on StgCmmPrim (operand out of range) -------------------------+-------------------------------------------------- Reporter: kgardas | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.7 Keywords: | Os: Linux Architecture: powerpc | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -------------------------+-------------------------------------------------- Changes (by erikd): * cc: mle+hs@… (added) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7598#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC