Go patch committed: Mark Call_expression multi-results as result struct

Message ID CAOyqgcX1MNR1Y9KdOvBd5AJLbNO8uE-ksW6jbPKVMq5wze6L_Q@mail.gmail.com
State Committed
Commit aa8f4242efc99f24de73c59d53996f28db28c13f
Headers
Series Go patch committed: Mark Call_expression multi-results as result struct |

Commit Message

Ian Lance Taylor March 29, 2023, 12:31 a.m. UTC
  This patch to the Go frontend marks a Call_expression multiple results
struct as a result struct.  In https://go.dev/cl/343873 we stopped
padding zero-sized trailing fields in functions that return multiple
results where the last result is zero-sized. This CL makes the
corresponding change on the caller side.

The test case is https://go.dev/cl/479898.

This fixes https://go.dev/issue/55242.

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

Ian
c8e7c9c973e6b0b3a3a061619831bc5df371f2ef
  

Patch

diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 8c8025dec2e..addef6f8f51 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@ 
-9ffd6e679ff0e3a908d0ec2ed5c6efa1de827c3f
+63ba7dd52f2cc49dab4b70ac81309296a920d4dc
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 53901306ef7..4ac55af7433 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -11267,6 +11267,7 @@  Call_expression::do_lower(Gogo* gogo, Named_object* function,
 
       Struct_type* st = Type::make_struct_type(sfl, loc);
       st->set_is_struct_incomparable();
+      st->set_is_results_struct();
       this->call_temp_ = Statement::make_temporary(st, NULL, loc);
       inserter->insert(this->call_temp_);
     }