gcc 13.0.0 20220717 snapshot (g:7bcd7f47359b903bf7a193b95d4450d9d69c60ba) fails -fcompare-debug check when compiling the following testcase w/ -mcpu=e500mc -O2 -fcompare-debug -fnon-call-exceptions -fsched-stalled-insns -fno-reorder-blocks -fno-thread-jumps -fno-tree-dce: int n; __attribute__ ((noinline)) int return_zero (void) { return 0; } __attribute__ ((noinline)) int return_one (void) { return 1; } __attribute__ ((noinline)) void empty (int) { } int foo (int x) { if (x) empty (n); else if (return_zero () == n) empty (return_one ()); return 0; } % powerpc-e300c3-linux-gnu-gcc-13.0.0 -mcpu=e500mc -O2 -fcompare-debug -fnon-call-exceptions -fsched-stalled-insns -fno-reorder-blocks -fno-thread-jumps -fno-tree-dce -c vjbxa62g.c powerpc-e300c3-linux-gnu-gcc-13.0.0: error: vjbxa62g.c: '-fcompare-debug' failure gkd diff: --- vjbxa62g.c.gkd 2022-07-23 13:54:24.325382258 +0700 +++ vjbxa62g.gk.c.gkd 2022-07-23 13:54:24.350381830 +0700 @@ -188,22 +188,17 @@ (insn:TI # 0 0 (set (reg/i:SI 3 3) (const_int 0 [0])) "vjbxa62g.c":29:1# {*movsi_internal1} (nil)) -(insn # 0 0 (unspec_volatile [ +(insn:TI # 0 0 (unspec_volatile [ (const_int 0 [0]) ] UNSPECV_BLOCK) "vjbxa62g.c":29:1# {blockage} (nil)) +(insn # 0 0 (use (reg/i:SI 3 3)) "vjbxa62g.c":29:1# + (nil)) (note # 0 0 NOTE_INSN_EPILOGUE_BEG) -(insn:TI # 0 0 (set (reg:SI 0 0) +(insn # 0 0 (set (reg:SI 0 0) (mem/c:SI (plus:SI (reg/f:SI 1 1) (const_int 36 [0x24])) [ S4 A8])) "vjbxa62g.c":29:1# {*movsi_internal1} (nil)) -(insn # 0 0 (use (reg/i:SI 3 3)) "vjbxa62g.c":29:1# - (nil)) -(insn/f # 0 0 (set (reg:SI 96 lr) - (reg:SI 0 0)) "vjbxa62g.c":29:1# {*movsi_internal1} - (expr_list:REG_DEAD (reg:SI 0 0) - (expr_list:REG_CFA_RESTORE (reg:SI 96 lr) - (nil)))) (insn:TI # 0 0 (set (reg:SI 31 31) (mem/c:SI (plus:SI (reg/f:SI 1 1) (const_int 28 [0x1c])) [ S4 A8])) "vjbxa62g.c":29:1# {*movsi_internal1} @@ -218,7 +213,12 @@ (expr_list:REG_CFA_DEF_CFA (reg/f:SI 1 1) (expr_list:REG_CFA_RESTORE (reg:SI 31 31) (nil)))) -(jump_insn:TI # 0 0 (simple_return) "vjbxa62g.c":29:1# {simple_return} +(insn/f:TI # 0 0 (set (reg:SI 96 lr) + (reg:SI 0 0)) "vjbxa62g.c":29:1# {*movsi_internal1} + (expr_list:REG_DEAD (reg:SI 0 0) + (expr_list:REG_CFA_RESTORE (reg:SI 96 lr) + (nil)))) +(jump_insn # 0 0 (simple_return) "vjbxa62g.c":29:1# {simple_return} (nil) -> simple_return) (barrier # 0 0)
Surya, might this be related to the sched1 -fcompare-debug issue you have a patch for? Or is this something new?
The issue reported here is the same as in bug 105586 The test provided in the description passes with the patch that fixes bug 105586, and fails w/o the patch. Hence closing this bug.