[New-bugs-announce] [issue42615] Redundant jump instructions due to deleted unreachable bytecode blocks

Om G report at bugs.python.org
Thu Dec 10 11:47:13 EST 2020


New submission from Om G <im.omgupta+python at gmail.com>:

During optimization, the compiler deletes blocks that are marked as unreachable. In doing so, it can render jump instructions that used to jump over the now-deleted blocks redundant, since simply falling through to the next non-empty block is now equivalent.

An example of a place where this occurs is around "if condition: statement; else: break" style structures (see attached proof of concept code below), but this is a general case and could occur in other places.

Tested on the latest 3.10 branch including all recent compile.c changes.

----------
files: jmptest.py
messages: 382834
nosy: OmG
priority: normal
severity: normal
status: open
title: Redundant jump instructions due to deleted unreachable bytecode blocks
type: performance
versions: Python 3.10
Added file: https://bugs.python.org/file49664/jmptest.py

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


More information about the New-bugs-announce mailing list