]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45773: Remove invalid peephole optimizations (GH-31066)
authorBrandt Bucher <brandt@python.org>
Thu, 3 Feb 2022 10:14:44 +0000 (02:14 -0800)
committerGitHub <noreply@github.com>
Thu, 3 Feb 2022 10:14:44 +0000 (10:14 +0000)
Misc/NEWS.d/next/Core and Builtins/2022-02-01-14-30-56.bpo-45773.Up77LD.rst [new file with mode: 0644]
Python/compile.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-02-01-14-30-56.bpo-45773.Up77LD.rst b/Misc/NEWS.d/next/Core and Builtins/2022-02-01-14-30-56.bpo-45773.Up77LD.rst
new file mode 100644 (file)
index 0000000..45da511
--- /dev/null
@@ -0,0 +1 @@
+Remove two invalid "peephole" optimizations from the bytecode compiler.
index 1d2d567e85e93e41498784d7277cf10ef813642d..cecd6a5c42660e7950f4ced35ec6bda17f53704e 100644 (file)
@@ -8757,7 +8757,6 @@ optimize_basic_block(struct compiler *c, basicblock *bb, PyObject *consts)
                 switch (target->i_opcode) {
                     case JUMP_ABSOLUTE:
                     case JUMP_FORWARD:
-                    case JUMP_IF_FALSE_OR_POP:
                         i -= jump_thread(inst, target, POP_JUMP_IF_FALSE);
                 }
                 break;
@@ -8765,7 +8764,6 @@ optimize_basic_block(struct compiler *c, basicblock *bb, PyObject *consts)
                 switch (target->i_opcode) {
                     case JUMP_ABSOLUTE:
                     case JUMP_FORWARD:
-                    case JUMP_IF_TRUE_OR_POP:
                         i -= jump_thread(inst, target, POP_JUMP_IF_TRUE);
                 }
                 break;