This Go frontend patch by Than McIntosh is an addendum to the fix for issue https://golang.org/issue/34577 (,https://gcc.gnu.org/ml/gcc-patches/2019-10/msg00366.html) which was not sufficiently general. During export data processing, when looking at the types of constants mentioned in inlinable function bodies, include both locally defined constants and constant imported from other packages. A testcase for this bug is in https://golang.org/cl/201017. This fixes https://golang.org/issue/34852. Bootstrapped and ran Go tests on x86_64-pc-linux-gnu. Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 276964) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -f71238c0112311e4525a1f4b76d2f80be87d2e62 +1e2d98b27701744cf0ec57b19d7fc8f594184b9a The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/export.cc =================================================================== --- gcc/go/gofrontend/export.cc (revision 276594) +++ gcc/go/gofrontend/export.cc (working copy) @@ -250,7 +250,7 @@ Collect_export_references::expression(Ex } const Named_object* nco = expr->named_constant(); - if (nco != 0 && nco->package() == NULL) + if (nco != 0) { const Named_constant *nc = nco->const_value(); Type::traverse(nc->type(), this);