We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Creating bit field using non-constant variables causing a code gen failure.
package main Foo :: bit_field u32 { val : int | 10, } main :: proc() { foo : Foo foo = Foo{val = 1} a :: 5 foo = Foo{val = a} b := 5 foo = Foo{val = b} // code gen failure }
No code gen failure.
Code gen failure
Please provide detailed steps for reproducing the issue.
|| [build.bat] || LLVM CODE GEN FAILED FOR PROCEDURE: main.main || define internal void @main.main(ptr noalias nocapture nonnull %__.context_ptr) { || decls: || %foo = alloca i32, align 4 || %0 = alloca i32, align 4 || %1 = alloca i32, align 4 || %b = alloca i64, align 8 || %2 = alloca i32, align 4 || br label %entry || || entry: ; preds = %decls || store i32 0, ptr %foo, align 4 || store i32 0, ptr %0, align 4 || store i32 1, ptr %0, align 4 || %3 = load i32, ptr %0, align 4 || store i32 %3, ptr %foo, align 4 || store i32 0, ptr %1, align 4 || store i32 5, ptr %1, align 4 || %4 = load i32, ptr %1, align 4 || store i32 %4, ptr %foo, align 4 || store i64 5, ptr %b, align 8 || store i32 0, ptr %2, align 4 || %5 = load i64, ptr %b, align 8 || %6 = zext i64 %5 to i32 || %7 = and i32 %6, 1023 || %8 = shl i32 %7, 0 || %9 = or i32 0, %8 || store i32 %9, ptr %2, align 4 || %10 = load i32, ptr %2, align 4 || store i32 %10, ptr %foo, align 4 || ret void || } || || || || || Type too small for ZExt || %6 = zext i64 %5 to i32 || [Finished in 0 seconds with code 1]
The text was updated successfully, but these errors were encountered:
This seems to specifically be the case when an individual field type is larger than the bit field type. val : int | 10 to val : u32 | 10 works fine.
Sorry, something went wrong.
97e9c50
No branches or pull requests
Context
Creating bit field using non-constant variables causing a code gen failure.
Odin: dev-2024-05
OS: Windows 10 Enterprise
Backend: LLVM 17.0.1
Expected Behavior
No code gen failure.
Current Behavior
Code gen failure
Failure Information (for bugs)
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Failure Logs
The text was updated successfully, but these errors were encountered: