Skip to content

compiler's eliminate_empty_basic_blocks does not remove empty block if it is the last in the compilation unit #95922

Closed
@iritkatriel

Description

@iritkatriel

Because of the next->b_next in the loop condition, this does not remove an empty basic block at the end. I put an assert and saw that this can happen.

     for (basicblock *b = entryblock; b != NULL; b = b->b_next) {
         basicblock *next = b->b_next;
        if (next) {
            while (next->b_iused == 0 && next->b_next) {
                next = next->b_next;
            }
            b->b_next = next;
         }
     }

Metadata

Metadata

Assignees

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usage

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions