classification
Title: Compiler front-end produces a broken CFG
Type: behavior Stage: resolved
Components: Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: BTaskaya, Mark.Shannon, pablogsal, yselivanov
Priority: normal Keywords: patch

Created on 2020-11-13 17:23 by Mark.Shannon, last changed 2020-11-23 16:49 by Mark.Shannon. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 23267 merged Mark.Shannon, 2020-11-13 17:27
Messages (2)
msg380911 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2020-11-13 17:23
The front-end of the bytecode compiler produces a broken CFG.
A number of "basic-block"s have terminators before their end.
This makes the back-end optimizations unsafe as they rely of a well-formed CFG.

The fix is simple. Insert a check that the CFG is well-formed before doing any optimizations, then fix up the front-end.

Once done, we can be more aggressive with optimizations without worrying that things will break for no apparent reason.
msg381279 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2020-11-17 19:30
New changeset 266b462238bddec0213effad3650f19c56511e9f by Mark Shannon in branch 'master':
bpo-42349: Compiler clean up. More yak-shaving for PEP 626. (GH-23267)
https://github.com/python/cpython/commit/266b462238bddec0213effad3650f19c56511e9f
History
Date User Action Args
2020-11-23 16:49:14Mark.Shannonsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-11-17 19:30:25Mark.Shannonsetmessages: + msg381279
2020-11-13 17:27:22Mark.Shannonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request22163
2020-11-13 17:23:56Mark.Shannoncreate