
#7814: panic in PPC NCG --------------------------------+------------------------------------------- Reporter: heisenbug | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: powerpc Failure: Building GHC failed | Blockedby: Blocking: | Related: --------------------------------+------------------------------------------- Comment(by heisenbug): The problem is in !JoinToTargets: {{{ ==================== Registers allocated ====================joinToTargets: making fixup code in block: cl jmp instruction: bne _co src assignment: [(cf, InReg (RealRegSingle 30)), (nv, InReg (RealRegSingle 31))] dest assignment: [(cf, InReg (RealRegSingle 31))] movement graph: [(cf, InReg (RealRegSingle 30), [InReg (RealRegSingle 31)])] sccs of graph: [NONREC (cf, InReg (RealRegSingle 30), [InReg (RealRegSingle 31)])] joinToTargets: fixup code is: nI: mr 31, 30 b _co }}} Here is the entire output when I disable the panic: {{{ stg_sel_0_upd_info: .Lcb: bcl 20,31,1f 1: mflr 31 lwz 30, .LnF-(1b)(31) add 31, 31, 30 mr 30, 14 addi 29, 22, -12 cmplw 29, 24 blt .Lcj .Lcl: addis 29, 31, .LC_stg_upd_frame_info-(.LCTOC1)+0@ha lwz 29, .LC_stg_upd_frame_info-(.LCTOC1)+0@l(29) stw 29, -8(22) stw 30, -4(22) lwz 30, 8(30) andi. 29, 30, 3 cmpwi 29, 0 bne .LnI .Lcn: addis 31, 31, .LC_ce_info-(.LCTOC1)+0@ha lwz 31, .LC_ce_info-(.LCTOC1)+0@l(31) stw 31, -12(22) mr 14, 30 addi 22, 22, -12 lwz 31, 0(30) mtctr 31 bctr .text .align 2 .long 0 .long 2097152 ce_info: .Lce: addi 22, 22, 12 mr 31, 14 .Lco: li 30, -4 and 31, 31, 30 lwz 14, 4(31) addi 22, 22, -8 addis 31, %vI_nv, .LC_stg_ap_0_fast-(.LCTOC1)+0@ha lwz 31, .LC_stg_ap_0_fast-(.LCTOC1)+0@l(31) mtctr 31 bctr .Lcj: mr 14, 30 lwz 31, -12(27) mtctr 31 bctr .LnI: mr 31, 30 b .Lco }}} Apparently the fixup code is in pace (as '.LnI'), but 1. why is it needed at all? (there are two branches to '_co', from 'ce' and 'cl') 2. in 'cl' (%vI_nv => r31) and in 'ce' %vI_nv is not used but marked as live in, dying on exit 3. who calls 'ce'? appears to have block_ce_info -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7814#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler