-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
arch-x86_6464-bit x8664-bit x86backend-self-hostedbugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviormiscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.regressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.
Milestone
Description
Zig Version
0.16.0-dev.1415+db622f14c (worked in 0.15.2)
Steps to Reproduce and Observed Behavior
Run the following Zig code that bitcasts a u3 to a bool vector:
const std = @import("std");
pub fn main() !void {
var value: u3 = 7;
_ = &value;
std.log.err("{any}", .{@as(@Vector(3, bool), @bitCast(value))});
}Observe how it produces false in newer versions with the x86_64 backend:
$ zig-debug run test.zig -fno-llvm
error: { false, false, false }
Expected Behavior
It should return true since all bits are set, this works in the llvm backend as well as the 0.15.2 x86_64 backend:
$ zig-debug run test.zig -fllvm
error: { true, true, true }
$ ~/Downloads/zig-x86_64-linux-0.15.2/zig run test.zig -fno-llvm
error: { true, true, true }
Metadata
Metadata
Assignees
Labels
arch-x86_6464-bit x8664-bit x86backend-self-hostedbugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviormiscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.regressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.