-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.miscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.
Milestone
Description
var lhs: @Vector(2, i8) = .{ -128, 0 };
const rhs: @Vector(2, i8) = .{ 1, -1 };
pub fn main() void {
_ = @divTrunc(lhs, rhs);
}
$ zig run repro.zig
thread 476777 panic: integer overflow
repro.zig:4:9: 0x103a524 in main (repro)
_ = @divTrunc(lhs, rhs);
^
lib/std/start.zig:647:22: 0x1039f72 in posixCallMainAndExit (repro)
root.main();
^
lib/std/start.zig:271:5: 0x1039b4d in _start (repro)
asm volatile (switch (native_arch) {
^
???:?:?: 0x0 in ??? (???)
Aborted (core dumped)
As an added bonus for fixing this bug, you can delete the lines in test/behavior/x86_64/math.zig
referencing this issue!
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.miscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.