-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Multiple unused code warnings in Python/generated_cases.c.h
#125515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not sure what we can do about the compiler compiling about if (CONVERSION_FAILED(x)) {
... // compiler complains this is unreachable
} as |
Is there anything else to do here? I actually have new warnings but I'm unsure whether you want to be them part of this issue: In file included from Python/ceval.c:1097:
Python/generated_cases.c.h:12157:13: warning: code will never be executed [-Wunreachable-code]
12157 | stack_pointer -= 3;
| ^~~~~~~~~~~~~
Python/generated_cases.c.h:12150:13: warning: code will never be executed [-Wunreachable-code]
12150 | stack_pointer -= 4;
| ^~~~~~~~~~~~~
Python/generated_cases.c.h:7462:13: warning: code will never be executed [-Wunreachable-code]
7462 | stack_pointer += -1;
| ^~~~~~~~~~~~~ I'm using clang-18 and the following configure: ./configure --with-undefined-behavior-sanitizer --prefix="$(pwd)/build" CC=clang LD=clang CFLAGS="-fsanitize=undefined -fno-sanitize-recover" LDFLAGS="-fsanitize=undefined -fno-sanitize-recover" -q |
From a conversation with @brandtbucher, the first two can be resolved by commenting out the The last error is more complicated; the offending block is this one; the complication is that it's the only opcode that can return from inside the instruction. The "unreachable code" is the automatically injected content that is done for cleanup after the return. The suggestion was that the code generator needs to be taught about that edge case so it doesn't inject the stack cleanup code. |
…ator (#133178) Mark code after "return" as unreachable
Remove two unused error branches in the generated bytecode handling.
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Link: https://github.com/python/cpython/actions/runs/11333284963/job/31517440086#step:6:1025
Report:
This looks like we have two different problems:
goto
andreturn
:cpython/Python/generated_cases.c.h
Lines 4747 to 4749 in cc5a225
cpython/Python/generated_cases.c.h
Lines 5061 to 5063 in cc5a225
CC @Fidget-Spinner
Linked PRs
The text was updated successfully, but these errors were encountered: