Description
Hey, I discovered a bug with tiered compilation that is generating an invalid code when a Vector128<double> is embedded in a struct and we perform calculation with it.
Reproduction Steps
Create a program with the following code, dotnet run -c Release
usingSystem.Runtime.Intrinsics;usingSystem.Runtime.CompilerServices;varrect=newPseudoPointF64(1.0,2.0);varresult=rect*2.0;Console.WriteLine(result);publicreadonlystructPseudoPointF64{privatereadonlyVector128<double>_value;publicPseudoPointF64(Vector128<double>value){_value=value;}publicPseudoPointF64(doublex,doubley){_value=Vector128.Create(x,y);}[MethodImpl(MethodImplOptions.AggressiveInlining)]publicstaticPseudoPointF64operator*(PseudoPointF64left,doubleright)=>new(left._value*Vector128.Create(right));publicoverridestringToString(){return_value.ToString();}}Expected behavior
It should print <2, 4>
Actual behavior
It prints <2, 0>
Regression?
No response
Known Workarounds
Add [MethodImpl(MethodImplOptions.AggressiveOptimizations)] to the method is fixing the issue.
Configuration
- dotnet --version 8.0.100
- x64
- Windows 11 Pro
- Version 23H2
- OS build 22631.2861
Other information
No response
Description
Hey, I discovered a bug with tiered compilation that is generating an invalid code when a
Vector128<double>is embedded in a struct and we perform calculation with it.Reproduction Steps
Create a program with the following code,
dotnet run -c ReleaseExpected behavior
It should print
<2, 4>Actual behavior
It prints
<2, 0>Regression?
No response
Known Workarounds
Add
[MethodImpl(MethodImplOptions.AggressiveOptimizations)]to the method is fixing the issue.Configuration
Other information
No response