[issue38135] Depth first search in compile.c creates wrong BB order for certain CFG.

Mark Shannon report at bugs.python.org
Thu Sep 12 07:19:40 EDT 2019


New submission from Mark Shannon <mark at hotpy.org>:

Consider a flow graph of four nodes, A, B, C, D
where the A, B, C are "next" successors of each other (in order) and C branches to B and B branches to D. Note that there is no "next" link to the D block.

The correct order is A, B, C, D but the 'dfs' function in compile.c produces the order A, B, D, C.

This is not an issue with the current compiler as it always add the "next" link from C to D, but this will become an issue when we use a more powerful CFG based optimizer than the current "peephole" optimizer.

----------
assignee: Mark.Shannon
components: Interpreter Core
messages: 352114
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Depth first search in compile.c creates wrong BB order for certain CFG.
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38135>
_______________________________________


More information about the Python-bugs-list mailing list