Missed Optimization when Matching on Complete Unicode Character Ranges with an Unreachable Arm #123927
Labels
A-codegen
Area: Code generation
C-bug
Category: This is a bug.
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
I-heavy
Issue: Problems and improvements with respect to binary size of generated code.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hello, I've noticed a bug with rustc:
which outputs:
Gives a compiler warning telling us that
_ => false
is unreachable, but it seems that the optimiser isn't privy to this? We'd expectwithout_unreachable
andwith_unreachable
to give the same assembly output.Meta
The above is built with rustc 1.77.0 and flags
-C debuginfo=1 --emit asm -Cllvm-args=--x86-asm-syntax=intel --crate-type rlib --color=always --edition 2021 -C opt-level=3
A link to the godbolt snippet: https://godbolt.org/z/hf7jje83W
The text was updated successfully, but these errors were encountered: