Go patch committed: Lower constant string comparisons

Ian Lance Taylor iant@google.com
Thu Feb 16 22:14:00 GMT 2012


This patch to the Go compiler lowers constant string comparisons at
compile time rather than runtime.  Not doing this led to a compiler
crash on code like

var V = "a" > "b"

because the compiler thinks that expressions involving only constants do
not require any runtime initialization, but string comparison requires a
function call.  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: 1386 bytes
Desc: patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120216/c5924821/attachment.bin>


More information about the Gcc-patches mailing list