Go patch committed: Rework range over slice

Ian Lance Taylor iant@google.com
Thu Dec 22 01:59:00 GMT 2011


This patch to the Go frontend reworks the range over slice support so
that the index operation does not normally require a bounds check.  I
did this by the simple expedient of copying the slice to a temporary
variable before doing the range.  This makes it safe for the optimizers
to eliminate the bounds checks.  I guess I could just avoid generating
the bounds checks in that case, but then the optimizers would get weak
and flabby.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 4692 bytes
Desc: patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111222/c9848516/attachment.bin>


More information about the Gcc-patches mailing list