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

Unused stack variable “may not be initialized” #680

Closed
vbgl opened this issue Jan 11, 2024 · 1 comment · Fixed by #1044
Closed

Unused stack variable “may not be initialized” #680

vbgl opened this issue Jan 11, 2024 · 1 comment · Fixed by #1044
Labels

Comments

@vbgl
Copy link
Member

vbgl commented Jan 11, 2024

Compilation of the program below fails with:

variable allocation: variable “s.159” (declared at "bug_680.jazz", line 3 (12-13)) may not be initialized

export
fn adc_stack(reg u64 x) {
  stack u64 s;
  s = 0;
  _, s += x;
}
@vbgl vbgl added the bug label Jan 11, 2024
@eponier
Copy link
Contributor

eponier commented Feb 7, 2024

I encountered the same bug. Here is another example

export fn main () -> reg u64 {
  reg u64 x;
  stack u64 y;

  x = 0;
  y = #MOV(x);
  return x;
}

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

Successfully merging a pull request may close this issue.

2 participants