Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: bounds check elimination thwarted by if-foruntil idiom #22236
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
changed the title
Bounds check elimination thwarted by if-foruntil idiom
Oct 12, 2017
I thought perhaps this had been fixed by all the work done on prove, but apparently not.
@aclements I think added some code that was supposed to catch just this idiom; the point is that this should match the rewrites used to avoid off-the-end pointers with preemptible loops, so perhaps the actual rewrite (the one that we care about) is different from this.
That the unsigned case is not caught is unsurprising, because signed is far and away the usual case, but the signed case is also not caught.