compiler: handle int-to-string conversion with large integer constant
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 31 May 2019 19:45:37 +0000 (19:45 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 31 May 2019 19:45:37 +0000 (19:45 +0000)
commit2b5360d7477277e7e0f32a5bd5479afac819b5e1
tree1aca42d25ab0d81d4d8e4f34c8d820152a3a2958
parentf2c2c4e30200463abd0ff1677daf16d49ad4f122
compiler: handle int-to-string conversion with large integer constant

    Currently, Type_conversion_expression::do_is_constant thinks the
    int-to-string conversion is constant if the integer operand is
    constant, but Type_conversion_expression::do_get_backend 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 CL makes it handle all constant integer input as constant,
    generating constant string.

    Fixes golang/go#32347.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/179777

From-SVN: r271821
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc