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

C backend hits unreachable compiling @call to lazy function with never_inline modifier #19905

Open
amp-59 opened this issue May 8, 2024 · 0 comments
Labels
backend-c The C backend (CBE) outputs C source code. bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@amp-59
Copy link
Contributor

amp-59 commented May 8, 2024

Zig Version

0.13.0-dev.75+5c9eb4081

Steps to Reproduce and Observed Behaviour

Compile example program with zig build-obj -ofmt=c fmtc_never_inline_args_unreach.zig
fmtc_never_inline_args_unreach.zig:

fn F(comptime T: type) type {
    return struct {
        fn f(_: T) void {}
    };
}
export fn entry() void {
    @call(.never_inline, F(u8).f, .{0});
}

Output:

zig build-obj -ofmt=c fmtc_never_inline_args_unreach.zig
Trace/breakpoint trap
@Vexu Vexu added bug Observed behavior contradicts documented or intended behavior backend-c The C backend (CBE) outputs C source code. labels May 9, 2024
@Vexu Vexu added this to the 0.14.0 milestone May 9, 2024
@Vexu Vexu changed the title Trace/breakpoint trap compiling @call to lazy function with never_inline modifier C backend hits unreachable compiling @call to lazy function with never_inline modifier May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend-c The C backend (CBE) outputs C source code. bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

2 participants