https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81426

--- Comment #11 from John Paul Adrian Glaubitz <glaubitz at physik dot 
fu-berlin.de> ---
Created attachment 56123
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56123&action=edit
Preprocessed source from building GHC with gcc-13

This is still present in gcc-13, I just ran into it while cross-building the
Haskell compiler GHC for sh4:

"inplace/bin/ghc-stage1" -optc-Wall -optc-Wall -optc-Wextra
-optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations
-optc-Winline -optc-Wpointer-ari
th -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls
-optc-Wno-aggregate-return -optc-Wno-unused-label -optc-DNOSMP
-optc-fno-strict-aliasing -optc-fno-
common -optc-Irts/dist-install/build/./autogen
-optc-Irts/include/../dist-install/build/include -optc-Irts/include/.
-optc-Irts/. -optc-DCOMPILING_RTS -optc-DFS_NAMESPACE=
rts -optc-Werror=unused-but-set-variable -optc-Wno-error=inline -optc-O2
-optc-fomit-frame-pointer -optc-g -optc-fno-omit-frame-pointer -optc-O0
-optc-g3 -optc-DRtsWay=\"r
ts_thr_debug\" -optc-ffunction-sections -optc-fdata-sections -static
-optc-DTHREADED_RTS -optc-DDEBUG  -H32m -O -lffi -optl-pthread -O0 -H64m -Wall 
-this-unit-id rts -opt
c-DNOSMP -dcmm-lint     -package-env - -i -irts -irts/dist-install/build
-Irts/dist-install/build -irts/dist-install/build/./autogen
-Irts/dist-install/build/./autogen -Ir
ts/include/../dist-install/build/include -Irts/include/. -Irts/.
-optP-DCOMPILING_RTS -optP-DFS_NAMESPACE=rts        -O2 -Wcpp-undef -O0  
-Wnoncanonical-monad-instances  
-c rts/ProfilerReport.c -o rts/dist-install/build/ProfilerReport.thr_debug_o
rts/sm/NonMovingMark.c: In function ‘mark_closure’:

rts/sm/NonMovingMark.c:1763:1: error:
     error: unable to find a register to spill in class ‘R0_REGS’
     1763 | }
          | ^
     |
1763 | }
     | ^

rts/sm/NonMovingMark.c:1763:1: error:  error: this is the insn:
     |
1763 | }
     | ^
(insn 1553 3768 1554 115 (parallel [
            (set (subreg:SI (reg:QI 7 r7 [803]) 0)
                (unspec_volatile:SI [
                        (mem/v:QI (reg/f:SI 3 r3 [orig:299 _160 ] [299]) [-1 
S1 A8])
                        (reg:QI 800 [ MEM[(struct StgStack *)_313].marking ])
                        (reg:QI 5 r5 [orig:802 nonmovingMarkEpoch ] [802])
                    ] UNSPECV_CMPXCHG_1))
            (set (mem/v:QI (reg/f:SI 3 r3 [orig:299 _160 ] [299]) [-1  S1 A8])
                (unspec_volatile:QI [
                        (const_int 0 [0])
                    ] UNSPECV_CMPXCHG_2))
            (set (reg:SI 147 t)
                (unspec_volatile:SI [
                        (const_int 0 [0])
                    ] UNSPECV_CMPXCHG_3))
            (clobber (scratch:SI))
            (clobber (reg:SI 0 r0))
            (clobber (reg:SI 1 r1))

        ]) "rts/include/stg/SMP.h":325:0: error:
    5 405 {atomic_compare_and_swapqi_soft_gusa}
         (expr_list:REG_DEAD (reg:QI 5 r5 [orig:802 nonmovingMarkEpoch ] [802])
            (expr_list:REG_DEAD (reg:QI 800 [ MEM[(struct StgStack
*)_313].marking ])
                (expr_list:REG_DEAD (reg/f:SI 3 r3 [orig:299 _160 ] [299])
                    (expr_list:REG_UNUSED (reg:SI 147 t)
                        (expr_list:REG_UNUSED (reg:SI 1 r1)
                            (expr_list:REG_UNUSED (reg:SI 0 r0)
                                (nil))))))))

rts/sm/NonMovingMark.c:1763:0: error:
     confused by earlier errors, bailing out
     |
1763 | }
     | ^

Attaching the preprocessed source for that.

Reply via email to