-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
JIT: Incorrect optimization of x & -x on x86 #66709
Comments
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsDescriptionThe following program gives an invalid result when optimizing on x86. Reproduction Steps// Generated by Fuzzlyn v1.5 on 2022-03-16 11:07:55
// Run on X86 Windows
// Seed: 13083630089409025722
// Reduced from 309.3 KiB to 0.2 KiB in 00:06:28
// Debug: Outputs 1
// Release: Outputs 4294967297
public class Program
{
public static long s_61 = -1;
public static void Main()
{
s_61 &= -s_61;
System.Console.WriteLine(s_61);
}
} Expected behaviorSame result with and without optimizations. Actual behaviorDifferent result. Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationProbably some interaction between long decomposition and the new optimization added in #66193? cc @Wraith2 @dotnet/jit-contrib
|
https://godbolt.org/z/bfEx84ovj |
It's a new optimization added in #66193. It's not part of .NET 6. |
As far as I know Godbolt always uses the daily builds, even if it says .NET 6. Referring to C# Community Discord discussion with @EgorBo |
@deeprobin I think it actually doesn't use daily builds, it uses some fixed version of .NET 7.0 daily build, probably a few month old |
No. Godbolt is currently using tag v6.0.1 as runtime, so it's .NET 6. You can confirm the version here: https://github.com/compiler-explorer/infra/blob/main/bin/yaml/dotnet.yaml#L11 |
Note that your compile options are invalid. Godbolt only supports below compiler options/switches for dotnet languages:
|
I'll take a look. |
By x86 do you mean then 32 bit build specifically? Because I can't get that to build locally. Or are we just talking x86 as in not arm. |
I mean the 32-bit build specifically. |
What errors are you getting? The standard build commands (passing |
Description
The following program gives an invalid result when optimizing on x86.
Reproduction Steps
Expected behavior
Same result with and without optimizations.
Actual behavior
Different result.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
Probably some interaction between long decomposition and the new optimization added in #66193? cc @Wraith2 @dotnet/jit-contrib
The text was updated successfully, but these errors were encountered: