about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/tests/run/int_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-27 05:31:15 +0000
committerbors <bors@rust-lang.org>2023-09-27 05:31:15 +0000
commit376f3f059059b7fdd1331c77103943fd7c22918c (patch)
tree21d22718efa9d5b2ab946d5dc46deb11801ebf4b /compiler/rustc_codegen_gcc/tests/run/int_overflow.rs
parentd206f2c0857eb879877f27508139dd62a40294c3 (diff)
parent64df5a851e1cb8c2ae539aa5331d48b8f3646bf4 (diff)
downloadrust-376f3f059059b7fdd1331c77103943fd7c22918c.tar.gz
rust-376f3f059059b7fdd1331c77103943fd7c22918c.zip
Auto merge of #116166 - Zalathar:unreachable, r=cjgillot
Skip MIR pass `UnreachablePropagation` when coverage is enabled

When coverage instrumentation and MIR opts are both enabled, coverage relies on two assumptions:

- MIR opts that would delete `StatementKind::Coverage` statements instead move them into bb0 and change them to `CoverageKind::Unreachable`.

- MIR opts won't delete all `CoverageKind::Counter` statements from an instrumented function.

Most MIR opts naturally satisfy the second assumption, because they won't remove coverage statements from bb0, but `UnreachablePropagation` can do so if it finds that bb0 is unreachable. If this happens, LLVM thinks the function isn't instrumented, and it vanishes from coverage reports.

A proper solution won't be possible until after per-function coverage info lands in #116046, but for now we can avoid the problem by turning off this particular pass when coverage instrumentation is enabled.

---

cc `@cjgillot` since I found this while investigating coverage problems encountered by #113970
`@rustbot` label +A-code-coverage +A-mir-opt
Diffstat (limited to 'compiler/rustc_codegen_gcc/tests/run/int_overflow.rs')
0 files changed, 0 insertions, 0 deletions