You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the problem is in the MSVC compiler.
The /d2ssa-cse- option used in Unity causes incorrect code generation https://godbolt.org/z/rfK5c6fGW
Keep in mind that error happens on other platforms aswell, for example, on WebGL. As far as I know, they don't use MSVC for compiling to WebAssembly. The conversion process is: C# => IL => IL2CPP => CPP => Emscripten => WebAssembly.
Sorry, I forgot to mention that in the initial post. I assumed the bug is in IL2CPP.
I am getting a similar error on WebGL platform and using the additional CppArgs doesn't seem to fix it (can't build the project). I did the native integer types test, and it also reports wrong.
Activity
oleg-st commentedon Jan 30, 2024
It looks like the problem is in the MSVC compiler.
The
/d2ssa-cse-option used in Unity causes incorrect code generationhttps://godbolt.org/z/rfK5c6fGW
Reported here:
https://developercommunity.visualstudio.com/t/The-d2ssa-cse--option-causes-incorrect/10574272
in0finite commentedon Jan 30, 2024
Keep in mind that error happens on other platforms aswell, for example, on WebGL. As far as I know, they don't use MSVC for compiling to WebAssembly. The conversion process is: C# => IL => IL2CPP => CPP => Emscripten => WebAssembly.
Sorry, I forgot to mention that in the initial post. I assumed the bug is in IL2CPP.
oleg-st commentedon Jan 30, 2024
WebGL fails the test with native integer types
https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0AXEUCuA7AHwAEAmARgFgAoIgZgAJT6Bhegb2vq8ZJPc+6CiZAJwAKACQAiNvjAALGGADWMACZixeHAEs8GAJQAGBMGAAzAKxIR5m0ZTAwtUQfoAed/QDs9AHx+9JbeAL5SBgDcAoJcwuLSsngKSqoaWnqGJmZWNnYiDk4uIm6ePv6BwWGR0TFxkjJyiirqmjgANhB4AObGphbWtvaOzq4eXr4BQaHhUVSCIdQLVEA=
Right answer is:
125
-3
125
WebGL reports:
18
18
125
Switching to ulong/long like last time might help here.
in0finite commentedon Jan 30, 2024
Nope, I tried using my fork of library with ulong/long, it doesn't work.
oleg-st commentedon Jan 30, 2024
A workaround for the MSVC problem:
Add
additionalIl2CppArgs: --compiler-flags="/d2SSAOptimizer-"toProjectSettings.assetkorvemaa commentedon Feb 19, 2024
I am getting a similar error on WebGL platform and using the additional CppArgs doesn't seem to fix it (can't build the project). I did the native integer types test, and it also reports wrong.
64310096
64236544
125
Any help would be great :)
oleg-st commentedon Feb 20, 2024
The WebGL platform does not have proper debugging tools to find the root cause.
You can report a problem with a native integers in WebGL to Unity.
oleg-st commentedon Apr 29, 2024
@Jake-NSW @in0finite
Looks like decompression works in Unity 2022.3.26f1 WebGL
in0finite commentedon Apr 29, 2024
Thanks for letting me know.
However, in the meantime, I switched to 2023.3.0b5 and the bug is still present here.