Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: unnecessary bounds checks are not removed #14808
Please answer these questions before submitting your issue. Thanks!
I composed a list of bounds checks that the compiler at tip can and cannot eliminate. For some I provided an alternative implementation.
pushed a commit
Mar 17, 2016
A case that maybe could be added to the doc above and loopbce.go is when writing to an array/slice from back to front e.g. for integer formatting:
This currently generates bounds checks but when writing the above with i = 0; i < len(buf); i++ the bounds checks are removed.