Open powerc9000 opened 2 weeks ago
Looks like an alignment issue with the amd64 sysv ABI, you can see in the following snippet that it is allocating the parameter on align 4
and then loading it as if it is align 16
:
define internal void @main.foos(<{ <2 x float>, <2 x float> }> %0, ptr noalias nocapture nonnull %__.context_ptr) {
decls:
%1 = alloca [4 x float], align 4
%2 = alloca [4 x float], align 32
%b = alloca [4 x float], align 32
br label %entry
entry: ; preds = %decls
store <{ <2 x float>, <2 x float> }> %0, ptr %1, align 1
%3 = load <4 x float>, ptr %1, align 16
%4 = load <4 x float>, ptr %1, align 16
Context
Odin: dev-2024-06:02f11dfde OS: macOS Sonoma 14.4.1 (build: 23F79, kernel: 23.4.0) CPU: Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz RAM: 16384 MiB Backend: LLVM 18.1.6
Calling linalg.mul with a
Matrix2
crashes with a EXC_I386_GPFLT (General fault). Only in-o:non
or-debug
o:speed
does not share the issue.from the discord it was believed this is because of bad code gen causing a bad stack pointer.
Expected Behavior
Dont crash.
Current Behavior
Crash
Failure Information (for bugs)
Disassembly
registers
Steps to Reproduce
Sample program