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

--- Comment #4 from qinzhao at gcc dot gnu.org ---
this should be a bug in the pass "stack".
if I modify the file "reg-stack.c" as following:
qinzhao@gcc10:~/Work/write_gcc/gcc$ git diff reg-stack.c
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 8f98bd85750..3d6519c95c9 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -3428,6 +3428,7 @@ rest_of_handle_stack_regs (void)
 #ifdef STACK_REGS
   reg_to_stack ();
   regstack_completed = 1;
+  df_analyze ();
 #endif
   return 0;
 }

the testing case will core dump at:
t.c: In function ‘foo’:
t.c:5:1: internal compiler error: in df_refs_verify, at df-scan.c:3991
    5 | }
      | ^
0xc3e634 df_refs_verify
        ../../write_gcc/gcc/df-scan.c:3991
0xc3e8a5 df_insn_refs_verify
        ../../write_gcc/gcc/df-scan.c:4075
0xc3ea83 df_bb_verify
        ../../write_gcc/gcc/df-scan.c:4107
0xc3f046 df_scan_verify()
        ../../write_gcc/gcc/df-scan.c:4228
0xc2576c df_verify()
        ../../write_gcc/gcc/df-core.c:1818
0xc23fdd df_analyze_1
        ../../write_gcc/gcc/df-core.c:1214
0xc2439e df_analyze()
        ../../write_gcc/gcc/df-core.c:1290
0x115d581 rest_of_handle_stack_regs
        ../../write_gcc/gcc/reg-stack.c:3431
0x115d5d2 execute
        ../../write_gcc/gcc/reg-stack.c:3461

looks like that the pass reg stack does not maintain the df information
correctly during its transformation.

Reply via email to