-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorstage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.
Milestone
Description
Zig Version
0.10.0-dev.1740+23715dcf6
Steps to Reproduce
Execute the following test with -target aarch64-linux-none or arm-linux-none:
test {
var y = @as(f80, 2.5);
try testing.expect(@floatToInt(u80, y) != 0);
}Expected Behavior
Compilation and test should both succeed.
Actual Behavior
Segfault occurs in LLVMConstReal when adding the safety check for the floatToInt operation (codegen.cpp:3854):
Segmentation fault at address 0x16b0
???:?:?: 0x63d64c9 in ??? (???)
[1] 6592 IOT instruction ./build/zig test testme.zig -target aarch64-linux-none --zig-lib-dir lib
I believe the problem is that we are lowering a FP constant for a value that we actually lower as an integer on ARM (and the safety check therefore also needs to be implemented in soft ops).
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorstage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.