rustc_codegen_llvm: Require opt-level >= 1
for index-based write_operand_repeatedly() loop
#147462
+79
−26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To make debugger stepping intuitive with
-Copt-level=0
. See the adjustedbasic-stepping.rs
test.This is kind of a revert of bd0aae9 (cg_llvm: use index-based loop in write_operand_repeatedly), except we don't revert it, we just make it conditional on
opt-level
. That commit regressedbasic-stepping.rs
, but it was not noticed since that test did not exist back then (it was added later in #144876). I have retroactively bisected to find that out.It seems messy to sprinkle if-cases inside of
write_operand_repeatedly()
so make the whole function conditional.The test that bd0aae9 added in
tests/codegen/issues/issue-111603.rs
already use-Copt-level=3
, so we don't need to adjust the compiler flags for it to keep passing.This PR takes us one step closer to fixing #33013.
CC #147426 which is related (there will be trivial conflicts for me to resolve in basic-stepping.rs once one of them lands)