From patchwork Tue Mar 8 21:54:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 1603181 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=lQx4GaVR; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KCpyw33Pcz9sGC for ; Wed, 9 Mar 2022 08:55:04 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 37ADC3857828 for ; Tue, 8 Mar 2022 21:55:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37ADC3857828 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1646776502; bh=VsqJTMGhtJl5vlcLjV6xo5qHyS+Bz1YNuytMIh+DpdI=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=lQx4GaVRfvTi4Bv6+J7Hn0DVVPBUSz/xXFKL3KExCzN7Ae38oxIRjGJ/1ZVReO6+B 48Bhx8RheXJKA4T7s+oHzIuoiYXYonB0OWyjU+qT5KZA2FW8p/j5/ughY0+H37jKkv 77xDqCDyOSABZZVUA29ASbOoxMQB+n4+acCd2NPk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id 23F603858C74 for ; Tue, 8 Mar 2022 21:54:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 23F603858C74 Received: by mail-ed1-x52f.google.com with SMTP id t1so268377edc.3 for ; Tue, 08 Mar 2022 13:54:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VsqJTMGhtJl5vlcLjV6xo5qHyS+Bz1YNuytMIh+DpdI=; b=JKpMS7gPIst4QR0JtB6+IZZalWMBilALHMWB/dhbw9IKeCSk0NkmP5/UViGk11WWGG +eRtWU7a4Snz1ga2KyalE4lTJCWfOg5ZaiMC9M9OfMQ2nSQi1Nh1kjnT5+ZgMmGZ4iRu qXmthhgQdLhdzRTiQvVbK6+/nNCHQ/usBmsoWUyYVUGs8lA15ARM5yH+SiHzwujztrSf PHaiFFE5Z3wDz1thBlyrcpbewxAotBh2Ng31zSXYWZkhS2t+uA7OXwajkfqqtLr6TzK6 F7UQyLkhOWR+vSc1RiBv0pnejCOlgyohrFqdXnn2SYWbGBBWBl7t9qQJcX3kBCz6ZQXq tHJA== X-Gm-Message-State: AOAM530VH0XszwvNgTlrr3QbnDIQarDO+0HtGTahk5Fwp69l/TFb16Pg gzMuH8/P+at7RlKllIrq/a1jj+cRYykFl/4A9aF7wgbZAw4s+w== X-Google-Smtp-Source: ABdhPJyRq+dbTEa+rNuQ6GF9048XOSu17b+K24GkIy/PVAu19HdLiOkYA00BEtxn2bkUnr7z+dk/FuRUNUm2NgX0des= X-Received: by 2002:a05:6402:492:b0:404:c4bf:8b7e with SMTP id k18-20020a056402049200b00404c4bf8b7emr17889298edv.318.1646776459682; Tue, 08 Mar 2022 13:54:19 -0800 (PST) MIME-Version: 1.0 Date: Tue, 8 Mar 2022 13:54:08 -0800 Message-ID: Subject: Go patch committed: ignore function type result name in export data To: gcc-patches , gofrontend-dev X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ian Lance Taylor via Gcc-patches From: Ian Lance Taylor Reply-To: Ian Lance Taylor Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This patch to the Go frontend ignores the function type result name when producing export data. 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. This is for GCC PR 104832. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian d94b2d7240906da100946b596050f1020b87415d diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index e68d2d967cc..d9b12695e5c 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -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. diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 8267f1565ce..3de0bd3ae61 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -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 {