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
Running the test in the default (-O Debug) build mode gives the indicated error with the inplace result on my x86_64-linux desktop machine.
$ zig version
0.7.1
$ zig test unexpected_aliasing.zip
Test [1/1] test"inplace_product_result_alias_bug"... expected 5.0e+00, found 2.0e+01
[...]
The generated code for complexPureMult shows that it does not expect the destination for the result to be an alias for the first argument, as it computes the first term (reading memory for all four values) and writes it to the destination before computing the second term (rereading all four values).
However complexInplaceMult violates the assumption, so the computed value is incorrect.
The text was updated successfully, but these errors were encountered:
This snippet of code demonstrates the bug, as observed in Zig 0.7.1
Running the test in the default (-O Debug) build mode gives the indicated error with the inplace result on my
x86_64-linux
desktop machine.The generated code for
complexPureMult
shows that it does not expect the destination for the result to be an alias for the first argument, as it computes the first term (reading memory for all four values) and writes it to the destination before computing the second term (rereading all four values).However
complexInplaceMult
violates the assumption, so the computed value is incorrect.The text was updated successfully, but these errors were encountered: