-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Functions sometimes disappear from coverage under MIR opts +Inline,+ConstProp
#117012
Comments
@rustbot label +A-code-coverage |
Mysteriously, if I run the same test file in So far I haven't tracked down the precise differences between affected binaries and unaffected binaries. |
The above test file was the result of reducing a much more complicated test file ( Unlike my simplified examples above, that |
This comment was marked as outdated.
This comment was marked as outdated.
OK, I think this is caused by the fact that |
Because I wasn't seeing anything missing/suspicious in the I was able to apply printf debugging by:
|
(Note that this is almost certainly a bug in coverage, not in MIR opts.)
Consider this coverage report, produced by
x test run-coverage --bless
on a new test file:All of these functions should look roughly the same in the coverage report, but instead three of them (
ne_good
,ne_good_message
,eq_bad_message
) are completely missing, despite the fact that they are all executed.The problem also occurs under
-Copt-level=2
or-Zmir-opt-level=3
, but I narrowed it down to just-Zmir-opt-level=1
plus theInline
andConstProp
passes. If I reduce the MIR opt level to 0, or remove either of those passes, I get the expected output where all functions are reported correctly.The text was updated successfully, but these errors were encountered: