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

            Bug ID: 126815
           Summary: internal compiler error: verify_flow_info failed
                    caused by r17-3204-ge02ce3b8c4574c
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liuhongt at gcc dot gnu.org
  Target Milestone: ---

cat t5.cc


struct Guard { ~Guard (); };      // EH cleanup: makes f() end its basic block
int f (int);
void sink (int);

void h (int a, int b, int c)
{
  Guard g;
  int t;
  if (c)
    t = f (a);                    // throwing call feeds the PHI
  else
    t = b;                        // non-constant: prevents jump threading
  if (t == 42)                    // t's only use
    __builtin_unreachable ();
  sink (a);
}

with gcc -O2

during GIMPLE pass: vrp
t5.cc:5:6: internal compiler error: verify_flow_info failed
0x32fd14b internal_error(char const*, ...)
        ~/gcc/diagnostic-global-context.cc:787
0x1443823 verify_flow_info()
       ~/gcc/cfghooks.cc:300
0x1abe07c checking_verify_flow_info()
        ~/gcc/cfghooks.h:221
0x1abe07c cleanup_tree_cfg_noloop
        ~/gcc/tree-cfgcleanup.cc:1271
0x1abe07c cleanup_tree_cfg(unsigned int)
        ~/gcc/tree-cfgcleanup.cc:1322
0x1908054 execute_function_todo
        ~/gcc/passes.cc:2069
0x190884b execute_todo
        ~/gcc/passes.cc:2152


Since r17-3204-ge02ce3b8c4574c, "Provide a DCE no-delete option.", PR
tree-optimization/126329), `simple_dce_from_worklist` inserts the replacement
`def = 0` assignment *after* a side-effecting call whose LHS it has just
cleared. If that call ends its basic block (EH edge, abnormal edge, ...) the
assignment is placed after control flow inside the block, and the
`cleanup_tree_cfg` run from vrp's TODO trips `verify_flow_info`.

Reply via email to