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

            Bug ID: 106719
           Summary: '-fcompare-debug' failure w/ -O2
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: compare-debug-failure
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: aarch64-linux-gnu

gcc 13.0.0 20220821 snapshot (g:d6a39c25c05c6ed5df8ce49eda719d17e40e29bb) fails
-fcompare-debug check when compiling the following testcase, reduced from
gcc/testsuite/gcc.dg/Wstringop-overflow-77.c, w/ -O2:

extern short int esi;
extern _Atomic short int easi;

void warn_atomic_nand_fetch (void)
{
  _Atomic short *psi = (_Atomic short*)((char*)&easi + 1);
  __atomic_nand_fetch (psi, esi, 0);
  psi = (_Atomic short*)((char*)&easi + 1);
}

% aarch64-linux-gnu-gcc-13.0.0 -O2 -fcompare-debug -w -c teikzxgb.c
aarch64-linux-gnu-gcc-13.0.0: error: teikzxgb.c: '-fcompare-debug' failure

--- teikzxgb.c.gkd      2022-08-23 13:50:28.040713478 +0700
+++ teikzxgb.gk.c.gkd   2022-08-23 13:50:28.078713682 +0700
@@ -67,8 +67,8 @@
      (expr_list:REG_DEAD (reg:SI 2 x2 [100])
         (int_list:REG_BR_PROB 536868 (nil)))
  -> 3)
-(note # 0 0 NOTE_INSN_EPILOGUE_BEG)
 (note # 0 0 [bb 4] NOTE_INSN_BASIC_BLOCK)
+(note # 0 0 NOTE_INSN_EPILOGUE_BEG)
 (insn # 0 0 (use (reg:DI 30 x30)) "teikzxgb.c":9:1#
      (nil))
 (jump_insn:TI # 0 0 (return) "teikzxgb.c":9:1# {*do_return}

Reply via email to