diff options
| author | 2026-02-19 20:07:56 +0100 | |
|---|---|---|
| committer | 2026-02-19 20:07:56 +0100 | |
| commit | 5ccb5432d0257fd5bdb92fcb22bd0fe58922498c (patch) | |
| tree | 6b0df5ed455deeb22bbdd580948aa1822d4ed650 | |
| parent | 7c6d9ed9e30d673333464a4d69ce49596a4c844f (diff) | |
cfg: dominator computation should ignore blocks with no predecessors
These didn't show up atp before but with inlining, for example, a
noreturn function, they could be introduced. And the pass ordering means
they wouldn't have been cleaned up before filldom(). An unreachable
block having no dominator makes sense too.
| -rw-r--r-- | ir/cfg.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -69,10 +69,10 @@ filldom(struct function *fn) fn->entry->idom = fn->entry; for (bool changed = 1; changed;) { changed = 0; - blk = fn->entry->lnext; do { int j; struct block *new = NULL; + if (blk->npred == 0) continue; for (j = 0; j < blk->npred; ++j) if ((new = blkpred(blk, j))->id < blk->id) break; assert(new); |