-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Two subsequent labels and unnecessary jmp
with opt-level=s
#126585
Comments
@rustbot label -needs-triage +C-optimization +T-compiler +A-codegen +A-LLVM |
Here are multiple solutions to this problem. It can be resolved by directly optimizing in IR (llvm/llvm-project#95919) or during the code generation phase (llvm/llvm-project#95921). I believe the code generation phase is the key point, and we can use |
Fixed by llvm/llvm-project#95919. |
Confirmed fixed by #127513, needs codegen test. |
Add a set of tests for LLVM 19 Close rust-lang#107681. Close rust-lang#118306. Close rust-lang#126585. r? compiler
Add a set of tests for LLVM 19 Close rust-lang#107681. Close rust-lang#118306. Close rust-lang#126585. r? compiler try-job: i686-msvc try-job: arm-android try-job: test-various
Add a set of tests for LLVM 19 Close rust-lang#107681. Close rust-lang#118306. Close rust-lang#126585. r? compiler try-job: i686-msvc try-job: arm-android try-job: test-various
Add a set of tests for LLVM 19 Close rust-lang#107681. Close rust-lang#118306. Close rust-lang#126585. r? compiler try-job: i686-msvc try-job: arm-android try-job: test-various
Add a set of tests for LLVM 19 Close rust-lang#107681. Close rust-lang#118306. Close rust-lang#126585. r? compiler try-job: i686-msvc try-job: arm-android try-job: test-various
I just stumbled past this and am confused by the comment
I would expect this to overflow if |
Add a set of tests for LLVM 19 Close rust-lang#107681. Close rust-lang#118306. Close rust-lang#126585. r? compiler
Add a set of tests for LLVM 19 Close rust-lang#107681. Close rust-lang#118306. Close rust-lang#126585. r? compiler
You're right, I made a logical error. |
The following code:
Generates two subsequent labels and an unnecessary
jmp
instruction:When compiled with
-C opt-level=s
using rustc1.79.0
.Godbolt: https://godbolt.org/z/fhTq3ssnK
P.S. For context, I am not too familiar with asm. I did not find any similar results while searching through the rustc and llvm issue trackers for "double | subsequent | unnecessary label" or "unnecessary jmp | jump". Please let me know how I can improve the quality of my issue reporting.
The text was updated successfully, but these errors were encountered: