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

Relational: Assert type bounds after branch #1698

Closed
wants to merge 2 commits into from
Closed

Conversation

michael-schwarz
Copy link
Member

After branches, it pays off to check that computed constraints remain consistent with type-bounds.

This closes #1697 where this issue manifested as a both branches dead message. The test is for an equivalent arithmetic on integer bot case.

Copy link
Member

@sim642 sim642 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI shows a lot of test failures with this.

What I'm wondering is why type bounds would be lost by branch to begin with?
I guess this assertion wasn't added there because intuitively type bounds would persist which would make this unnecessary, but seems like that's not the case?

@michael-schwarz
Copy link
Member Author

The CI shows a lot of test failures with this.

Yeah, I used e instead of e' by mistake.

What I'm wondering is why type bounds would be lost by branch to begin with?

This is avery good question I also have no answer to.

@michael-schwarz
Copy link
Member Author

The remaining regression test are ones where the termination analysis tries to build non-terminating loops over int, which does not work because that analysis set the assume_none flag.

@sim642
Copy link
Member

sim642 commented Feb 27, 2025

The remaining regression test are ones where the termination analysis tries to build non-terminating loops over int, which does not work because that analysis set the assume_none flag.

This might be the place where I wondered about a #1696 (comment) -like situation before: what's supposed to happen if we want to assume that something, which definitely happens, does not happen?
It's the kind of nonsense where UB allows compilers to do weird things (delete the loop altogether or whatever), but I don't know what an analyzer should do about it.

@michael-schwarz
Copy link
Member Author

Closed in favor of #1699.

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

Successfully merging this pull request may close these issues.

Both branches dead for short circuiting && and Octagons
3 participants