This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Depth first search in compile.c creates wrong BB order for certain CFG.
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: Mark.Shannon, gregory.p.smith, pablogsal
Priority: normal Keywords: patch

Created on 2019-09-12 11:19 by Mark.Shannon, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 16042 merged Mark.Shannon, 2019-09-12 12:53
PR 16050 merged twouters, 2019-09-12 13:47
Messages (3)
msg352114 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2019-09-12 11:19
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.
msg352169 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2019-09-12 14:05
New changeset 99b54d68172ad64ba3d0fdc0137f0df88c28ea2b by Gregory P. Smith (T. Wouters) in branch 'master':
Revert "Fix depth-first-search computation in compile.c (GH-16042)" (GH-16050)
https://github.com/python/cpython/commit/99b54d68172ad64ba3d0fdc0137f0df88c28ea2b
msg392905 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2021-05-04 14:44
This seems to have been fixed sometime.
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82316
2021-05-04 14:44:34Mark.Shannonsetstatus: open -> closed
resolution: fixed
messages: + msg392905

stage: patch review -> resolved
2019-09-12 14:05:36gregory.p.smithsetnosy: + gregory.p.smith
messages: + msg352169
2019-09-12 13:47:00twouterssetpull_requests: + pull_request15672
2019-09-12 12:53:19Mark.Shannonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request15664
2019-09-12 11:20:11Mark.Shannonsetnosy: + pablogsal
2019-09-12 11:19:40Mark.Shannoncreate