This repository has been archived by the owner on Nov 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 510
Bad codegen in Boolean::TryParse #5661
Comments
Blocking AvaloniaUI/Avalonia#1476. @sandreenko Is my analysis remotely correct? Could you point me in the right direction? JitDump: The interesting lines are the ones with |
Thanks for your analysis, it looks correct, I will try to fix it asap. |
MichalStrehovsky
added a commit
to MichalStrehovsky/corert
that referenced
this issue
Apr 9, 2018
When I was investigating dotnet#5661 yesterday I found we're asserting RyuJIT when compiling `System.IO.BinaryReader:.ctor(ref,ref,bool)`. This works around the issue. No new bug filed since we track this in dotnet#5180.
MichalStrehovsky
added a commit
that referenced
this issue
Apr 9, 2018
It is a value numbering problem where we for some reasons have wrong null VNs for both true and false cases. I am working on the fix. |
MichalStrehovsky
added a commit
to MichalStrehovsky/corert
that referenced
this issue
Apr 12, 2018
Picks up dotnet/coreclr#17506. Fixes dotnet#5661.
Merged
sergiy-k
pushed a commit
that referenced
this issue
Apr 13, 2018
Picks up dotnet/coreclr#17506. Fixes #5661.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
TryParse(ReadOnlySpan<char> value, out bool result)
accesses two string literals and makes a Span out of them - "True" and "False".RyuJIT with optimizations enabled will reuse the first Span for "True" instead of making a new one for "False".
To repro, simply compile
Console.WriteLine(Boolean.Parse("False"));
with optimizations enabled. It will throw an exception because we don't match "False" to "False", but try to match "True" twice.My guess is there's something wrong with this piece of code in RyuJIT:
https://github.com/dotnet/coreclr/blob/0f0320e58fd006a02cdecf7ae45426f54da333e5/src/jit/gentree.cpp#L6426-L6430
The text was updated successfully, but these errors were encountered: