3 ms·
I am only moderately surprised by this, because I have seen some less egrigious intermittent miscompilations in stage1 such as this one: https://github.com/zigl
by anonymoushn 4y ago
I am only moderately surprised by this, because I have seen some less egrigious intermittent miscompilations in stage1 such as this one: https://github.com/ziglang/zig/issues/11786 https://github.com/ziglang/zig/issues/11786
I cannot provide the full program in which it failed, and the small programs I tried did not cause it to fail at the time.
I sort of expect these things to be fixed though. Like, eventually both Zig and unsafe Rust will actually have defined semantics, and eventually expressions containing `if (false) { X(); }` will not call X, and so on.
Edit: after seeing the linked issue in a sibling comment, this is even less surprising. stage1's handling of basically any complex expression in struct/tuple literals is quite bad. I've mostly had it crash the compiler, but it's not surprising that it can also just evaluate incorrectly. It seems plausible that the actual solution to all this is to use stage2 instead, but we cannot move all of our programs to stage2 today because we use async.