From: Ian Lance Taylor Date: Fri, 25 Oct 2019 19:10:34 +0000 (+0000) Subject: compiler: don't inline integer expressions with named types X-Git-Tag: releases/gcc-9.3.0~472 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f36defc3f327015af9a074bd6adc008a6bee69d6;p=thirdparty%2Fgcc.git compiler: don't inline integer expressions with named types This works around the problem on GCC 9 branch. The problem is fixed in a better way on trunk; see https://golang.org/issue/34577. Fixes https://golang.org/issue/35154 From-SVN: r277461 --- diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 6f9775dd5a20..859c1ece5da9 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -2036,7 +2036,11 @@ class Integer_expression : public Expression int do_inlining_cost() const - { return 1; } + { + if (this->type_ != NULL && this->type_->named_type() != NULL) + return 0x100000; + return 1; + } void do_export(Export_function_body*) const; @@ -2451,7 +2455,11 @@ class Float_expression : public Expression int do_inlining_cost() const - { return 1; } + { + if (this->type_ != NULL && this->type_->named_type() != NULL) + return 0x100000; + return 1; + } void do_export(Export_function_body*) const; @@ -2664,7 +2672,11 @@ class Complex_expression : public Expression int do_inlining_cost() const - { return 2; } + { + if (this->type_ != NULL && this->type_->named_type() != NULL) + return 0x100000; + return 2; + } void do_export(Export_function_body*) const;