Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler crashes when computing with non-square matrices at compile time #4854

Open
prescientmoon opened this issue Feb 18, 2025 · 1 comment

Comments

@prescientmoon
Copy link
Contributor

Consider this source code:

package repro

CONSTANT: f32 : 1.3

main :: proc() {
	mat1: matrix[2, 3]f32
	mat2: matrix[2, 3]f32

	mat3: matrix[2, 3]f32 = CONSTANT * mat1 + (1 - CONSTANT) * mat2
}

This currently causes a compiler crash:

src/llvm_backend_const.cpp(659): Assertion Failure: `row == column` 
/run/user/1000/just/just-roW35R/odin: line 8: 103367 Illegal instruction     (core dumped)

Here's the source code section mentioned in the error:

	} else if (is_type_matrix(type) &&
		value.kind != ExactValue_Invalid &&
		value.kind != ExactValue_Compound) {
		i64 row = type->Matrix.row_count;
		i64 column = type->Matrix.column_count;
		GB_ASSERT(row == column);
		
		Type *elem = type->Matrix.elem;

It seems like the compiler simply gives up when computing with non-square matrices 🤔

@prescientmoon prescientmoon changed the title Compiler crashes when computing with non-square matrices at compiile time Compiler crashes when computing with non-square matrices at compile time Feb 18, 2025
@rezwanahmedsami
Copy link

can you guys asign me this issue ?
i will work on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants