This patch to the Go frontend by Cherry Zhang fixes int-to-string
conversion with large integer constants.

Currently, the type conversion code thinks the int-to-string
conversion is constant if the integer operand is constant, but it
actually generates a call to runtime.intstring if the integer does not
fit in a "ushort", which makes it not suitable in constant context,
such as static initializer.

This patch makes it handle all constant integer input as constants,
generating a constant string.

This fixes https://golang.org/issue/32347.

Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

I am unable to attach the actual patch, as GMail rejects it for some
unknown reason.  To see the patch, please see
https://golang.org/cl/179777 or
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=271821

Ian

Reply via email to