powerpc: SCCs aren't in reverse dependent order
Current ghc-HEAD fails build as:
$ ./configure --target=powerpc-unknown-linux-gnu
$ make
...
===--- building phase 0
make --no-print-directory -f ghc.mk phase=0 phase_0_builds
make[1]: Nothing to be done for 'phase_0_builds'.
===--- building phase 1
make --no-print-directory -f ghc.mk phase=1 phase_1_builds
make[1]: Nothing to be done for 'phase_1_builds'.
===--- building final phase
make --no-print-directory -f ghc.mk phase=final all
"inplace/bin/ghc-stage1" -static -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -DFS_NAMESPACE=rts -this-unit-id rts -dcmm-lint -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/HeapStackCheck.cmm -o rts/dist/build/HeapStackCheck.o
ghc-stage1: panic! (the 'impossible' happened)
(GHC version 8.9.20190318 for powerpc-unknown-linux):
RegAlloc.Liveness.computeLiveness
SCCs aren't in reverse dependent order
bad blockId n3U
[NONREC
cw: li %vI_n3Y, 1
lwz %vI_n3Z, 812(27)
sth %vI_n3Y, 16(%vI_n3Z)
stw %vI_c1, 832(27)
mr 14, 27
b stg_returnToSched,
NONREC
ct: lwz %vI_n3X, 0(24)
mtctr %vI_n3X
bctr,
NONREC
c9: li %vI_c1, 3
b _cw,
NONREC
cs: lwz %vI_n3V, 812(27)
lwz %vI_n3W, 20(%vI_n3V)
andi. 0, %vI_n3W, 256
bne _c9
b _ct,
NONREC
n3T:
bge _ct
b _cs,
NONREC
cr: lwz %vI_n3Q, 812(27)
lwz %vI_n3R, 68(%vI_n3Q)
lwz %vHi_H3R, 64(%vI_n3Q)
lis %vI_n3S, 0
ori %vI_n3S, %vI_n3S, 0
lis %vHi_H3S, 0
ori %vHi_H3S, %vHi_H3S, 0
cmpw %vHi_H3R, %vHi_H3S
bne _n3T
cmpwi %vHi_H3R, 0
ble _n3U
cmplw %vI_n3R, %vI_n3S
b _n3T
cmplw %vI_n3S, %vI_n3R
b _n3T,
NONREC
cq: lwz %vI_n3P, 912(27)
cmpwi %vI_n3P, 0
bne _c9
b _cr,
NONREC
cc: li %vI_n3j, 0
stw %vI_n3j, 828(27)
lwz %vI_cj, 820(27)
addi %vI_n3k, 26, 4
stw %vI_n3k, 4(%vI_cj)
lwz %vI_ci, 812(27)
lwz %vI_n3l, 68(%vI_ci)
lwz %vHi_H3l, 64(%vI_ci)
lwz %vI_n3m, 0(%vI_cj)
addi %vI_n3n, 26, 4
subf %vI_n3o, %vI_n3m, %vI_n3n
mr %vI_n3p, %vI_n3o
li %vHi_H3p, 0
subfc %vI_n3q, %vI_n3p, %vI_n3l
subfe %vHi_H3q, %vHi_H3p, %vHi_H3l
stw %vI_n3q, 68(%vI_ci)
stw %vHi_H3q, 64(%vI_ci)
lwz %vI_n3r, 916(27)
lwz %vI_n3s, 820(27)
lwz %vI_n3t, 0(%vI_n3s)
lwz %vI_n3u, 820(27)
lwz %vI_n3v, 4(%vI_n3u)
subf %vI_n3w, %vI_n3t, %vI_n3v
srwi %vI_n3x, %vI_n3w, 2
add %vI_n3y, %vI_n3r, %vI_n3x
stw %vI_n3y, 916(27)
lwz %vI_n3z, 820(27)
lwz %vI_n3A, 8(%vI_n3z)
stw %vI_n3A, 820(27)
lwz %vI_n3B, 820(27)
lwz %vI_n3C, 0(%vI_n3B)
lwz %vI_n3D, 820(27)
stw %vI_n3C, 4(%vI_n3D)
lwz %vI_cl, 820(27)
lwz %vI_cm, 4(%vI_cl)
addi 26, %vI_cm, -4
lwz %vI_cn, 0(%vI_cl)
lwz %vI_n3E, 28(%vI_cl)
slwi %vI_n3F, %vI_n3E, 12
addi %vI_n3G, %vI_n3F, -1
add %vI_n3H, %vI_cn, %vI_n3G
stw %vI_n3H, 804(27)
lwz %vI_ck, 812(27)
lwz %vI_n3I, 68(%vI_ck)
lwz %vHi_H3I, 64(%vI_ck)
subf %vI_n3J, %vI_cn, %vI_cm
mr %vI_n3K, %vI_n3J
li %vHi_H3K, 0
addc %vI_n3L, %vI_n3I, %vI_n3K
adde %vHi_H3L, %vHi_H3I, %vHi_H3K
stw %vI_n3L, 68(%vI_ck)
stw %vHi_H3L, 64(%vI_ck)
lwz %vI_n3M, 908(27)
cmpwi %vI_n3M, 0
bne _c9
b _cq,
NONREC
c8: li %vI_c1, 2
b _cw,
NONREC
c5: li %vI_c1, 1
b _cw,
NONREC
c7: lis %vI_n3d, g0@ha
lwz %vI_n3e, g0@l(%vI_n3d)
lwz %vI_n3f, 28(%vI_n3e)
lis %vI_n3g, large_alloc_lim@ha
lwz %vI_n3h, large_alloc_lim@l(%vI_n3g)
cmplw %vI_n3f, %vI_n3h
bge _c5
b _c8,
NONREC
ce: lwz %vI_n3N, 820(27)
lwz %vI_n3O, 8(%vI_n3N)
cmpwi %vI_n3O, 0
beq _c5
b _cc,
NONREC
cb: lwz %vI_n3i, 828(27)
cmplwi %vI_n3i, 4096
bgt _c5
b _ce,
NONREC
c4: lwz %vI_n3b, 820(27)
lwz %vI_n3c, 8(%vI_n3b)
cmpwi %vI_n3c, 0
beq _c5
b _c7,
NONREC
c2: lwz %vI_n39, 828(27)
subf 26, %vI_n39, 26
lwz %vI_n3a, 804(27)
cmpwi %vI_n3a, 0
beq _c9
b _cb,
NONREC
cx: lwz %vI_n38, 804(27)
cmplw 26, %vI_n38
bgt _c2
b _c4]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1169:37 in ghc:Outputable
pprPanic, called at compiler/nativeGen/RegAlloc/Liveness.hs:831:28 in ghc:RegAlloc.Liveness
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
make[1]: *** [rts/ghc.mk:318: rts/dist/build/HeapStackCheck.o] Error 1
make: *** [Makefile:128: all] Error 2
A bit of extra detail on stage1:
$ inplace/bin/ghc-stage1 --info
[("Project name","The Glorious Glasgow Haskell Compilation System")
,("GCC extra via C opts"," -fwrapv -fno-builtin")
,("C compiler command","powerpc-unknown-linux-gnu-gcc")
,("C compiler flags","")
,("C compiler link flags"," -fuse-ld=gold")
,("C compiler supports -no-pie","YES")
,("Haskell CPP command","powerpc-unknown-linux-gnu-gcc")
,("Haskell CPP flags","-E -undef -traditional")
,("ld command","powerpc-unknown-linux-gnu-ld.gold")
,("ld flags","")
,("ld supports compact unwind","YES")
,("ld supports build-id","YES")
,("ld supports filelist","NO")
,("ld is GNU ld","YES")
,("ar command","powerpc-unknown-linux-gnu-ar")
,("ar flags","q")
,("ar supports at file","YES")
,("ranlib command","powerpc-unknown-linux-gnu-ranlib")
,("touch command","touch")
,("dllwrap command","/bin/false")
,("windres command","/bin/false")
,("libtool command","libtool")
,("cross compiling","YES")
,("target os","OSLinux")
,("target arch","ArchPPC")
,("target word size","4")
,("target has GNU nonexec stack","True")
,("target has .ident directive","True")
,("target has subsections via symbols","False")
,("target has RTS linker","YES")
,("Unregisterised","NO")
,("LLVM llc command","llc")
,("LLVM opt command","opt")
,("LLVM clang command","clang")
,("Project version","8.9.20190318")
,("Project Git commit id","6113d0d4540af7853c71e9f42a41c3b0bab386fd")
,("Booter version","8.6.4")
,("Stage","1")
,("Build platform","x86_64-unknown-linux")
,("Host platform","x86_64-unknown-linux")
,("Target platform","powerpc-unknown-linux")
,("Have interpreter","YES")
,("Object splitting supported","NO")
,("Have native code generator","YES")
,("Support SMP","YES")
,("Tables next to code","YES")
,("RTS ways","l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn thr_debug_p debug_p")
,("RTS expects libdw","NO")
,("Support dynamic-too","YES")
,("Support parallel --make","YES")
,("Support reexported-modules","YES")
,("Support thinning and renaming package flags","YES")
,("Support Backpack","YES")
,("Requires unified installed package IDs","YES")
,("Uses package keys","YES")
,("Uses unit IDs","YES")
,("Dynamic by default","NO")
,("GHC Dynamic","NO")
,("GHC Profiled","NO")
,("Leading underscore","NO")
,("Debug on","False")
,("LibDir","/home/slyfox/dev/git/ghc-ppc/inplace/lib")
,("Global Package DB","/home/slyfox/dev/git/ghc-ppc/inplace/lib/package.conf.d")
]