diff options
author | bors <bors@rust-lang.org> | 2023-02-19 18:17:26 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2023-02-19 18:17:26 +0000 |
commit | 7aa413d59206fd511137728df3d9e0fd377429bd (patch) | |
tree | a65a0c418211c9e35c42d07245bbf42d5f1469c1 /tests/rustdoc-js-std/parser-errors.js | |
parent | dc89a803d64fb6172c8406996831353bee18c3a7 (diff) | |
parent | 9f6c1df8723504d7d468c87af02670dd0067cc7b (diff) | |
download | rust-7aa413d59206fd511137728df3d9e0fd377429bd.tar.gz |
Auto merge of #107921 - cjgillot:codegen-overflow-check, r=tmiasko
Make codegen choose whether to emit overflow checks
ConstProp and DataflowConstProp currently have a specific code path not to propagate constants when they overflow. This is meant to have the correct behaviour when inlining from a crate with overflow checks (like `core`) into a crate compiled without.
This PR shifts the behaviour change to the `Assert(Overflow*)` MIR terminators: if the crate is compiled without overflow checks, just skip emitting the assertions. This is already what happens with `OverflowNeg`.
This allows ConstProp and DataflowConstProp to transform `CheckedBinaryOp(Add, u8::MAX, 1)` into `const (0, true)`, and let codegen ignore the `true`.
The interpreter is modified to conform to this behaviour.
Fixes #35310
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions