]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: ignore function type result name in export data
authorIan Lance Taylor <iant@golang.org>
Tue, 8 Mar 2022 21:30:02 +0000 (13:30 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 8 Mar 2022 21:53:59 +0000 (13:53 -0800)
This change ensures that we never output a result name in the export
data if there is only a single result.  Previously we would output a ?
if the single result had a name.  That made the output unstable,
because the hashing ignores the result name, so whether we output a ?
or not depended on how equal hash elements were handled.

For https://gcc.gnu.org/PR104832

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

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/types.cc

index e68d2d967ccdded81b54896d891f8c5b4978a4f7..d9b12695e5cf83945697f91ba30bf4aabb4c26f6 100644 (file)
@@ -1,4 +1,4 @@
-787fd4475f9d9101bc138d0b9763b0f5ecca89a9
+5042f7efbdb2d64537dfef53a19e96ee5ec4db2d
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 8267f1565ce6c37a71df94693f8b4ae12516b167..3de0bd3ae61d64e3a460d7644fb15c3aeb242112 100644 (file)
@@ -5303,7 +5303,7 @@ Function_type::do_export(Export* exp) const
   if (results != NULL)
     {
       exp->write_c_string(" ");
-      if (results->size() == 1 && results->begin()->name().empty())
+      if (results->size() == 1)
        exp->write_type(results->begin()->type());
       else
        {