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

Assertion failure in register allocation #827

Closed
vbgl opened this issue Jun 7, 2024 · 1 comment · Fixed by #830
Closed

Assertion failure in register allocation #827

vbgl opened this issue Jun 7, 2024 · 1 comment · Fixed by #830

Comments

@vbgl
Copy link
Member

vbgl commented Jun 7, 2024

The following program does not make much sense but confuses a lot the compiler.

inline fn aux(reg u8 x) -> inline u8 {
  inline u8 r;
  if x == 0 { r = 0; }
  return r;
}

export fn main() -> reg u8 {
  reg u8 t;
  t = aux(0);
  return t;
}
@vbgl
Copy link
Member Author

vbgl commented Jun 7, 2024

Compiling this program crashes with an assertion failure in register-allocation. This might be seen as a duplicate of #828: if the compiler ensured that inline variables are gone before register-allocation, this program would be rejected early before the assertion failure can be triggered.

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

Successfully merging a pull request may close this issue.

1 participant