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

Safety checker crashes on DIV and IDIV #561

Closed
eponier opened this issue Sep 5, 2023 · 5 comments · Fixed by #574
Closed

Safety checker crashes on DIV and IDIV #561

eponier opened this issue Sep 5, 2023 · 5 comments · Fixed by #574

Comments

@eponier
Copy link
Contributor

eponier commented Sep 5, 2023

The safety checker thinks that these instructions take 2 arguments, while they take 3. I do not know how to fix that properly.

@vbgl
Copy link
Member

vbgl commented Sep 5, 2023

Can you please provide a minimal failing example? Thanks.

@eponier
Copy link
Contributor Author

eponier commented Sep 6, 2023

Sure, sorry!

export fn divEx1() -> reg u64 {
  reg u64 hi, lo, divisor, res;
  hi = 0;
  lo = 20;
  divisor = 5;
  ?{RAX=res} = #IDIV (hi, lo, divisor);
  return res;
}

Btw, I did not know that we could/had to do ?{RAX=res}.

@eponier
Copy link
Contributor Author

eponier commented Sep 6, 2023

jasminc -checksafety div.jazz
Default checker parameters.

Analyzing function divEx1
Fatal error: exception File "src/utils.ml", line 43, characters 51-57: Assertion failed

@vbgl
Copy link
Member

vbgl commented Sep 6, 2023

Thanks. Fixing the assertion failure should be easy, but making the correct safety checks seems trickier.

@vbgl
Copy link
Member

vbgl commented Sep 15, 2023

I went for the easy fix in #574.

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.

2 participants