From patchwork Wed Jan 31 02:11:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 867760 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-472337-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="NTliCZW+"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zWRZF693cz9s71 for ; Wed, 31 Jan 2018 13:11:31 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=OuwgONQF+vDwmV8TPlZS4cCnmzSi7om/equrfh90viDwxU id2N30p2lsqXRQfWQMWHDyyn2+Y2YCePCjbqDl0lv1nvPOXugn2+MiKGJBUs5XN4 +175Pu397orh9HcPnmG5KVthjPTxvesFqY7ED3ZV27qM/LQbdl2MVswvy8ips= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=mv+nvIZtFYpY4bbU2YByFFlxW4E=; b=NTliCZW+yl3ZxWOnZWGo f9CwLYGNwApfyd5BmeRS5O2mVW8wzZEW7TlGtk+ivgMxG584R7KZCzabdpRTOHah 5LocQlzUh4qMuLs5aeYEwMk1JLWQF43LJD/YzmRD1+q0tnNvpMI4ew11xBQ9qXTE wmegns68YR1GfV3hVkGGFmA= Received: (qmail 61090 invoked by alias); 31 Jan 2018 02:11:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 61065 invoked by uid 89); 31 Jan 2018 02:11:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Fun, Hx-languages-length:2031 X-HELO: mail-wm0-f54.google.com Received: from mail-wm0-f54.google.com (HELO mail-wm0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 31 Jan 2018 02:11:14 +0000 Received: by mail-wm0-f54.google.com with SMTP id 141so4872988wme.3 for ; Tue, 30 Jan 2018 18:11:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4iHfpxD9gEZtOHygSq/bGLLOY2epQmZxiwsBNNmnSvs=; b=E8grM0jYOLXm/PJA7D1SPbd1ZCBpm6EBfIDFzzouKnwA0kC3eTv4oru7Xn0B6JlyFR kkWs3L1ghbd1Tt99Ym3UX2xEaC8wN8xARbfy0A5sROgJj/9YpL2ffJEm3ywOGvjn7YaG j5EUk9KcmUuMsmXJF+9oyL40wJze56LW+rvDkjLFJnrlTX82VOPDGSPZ4C39TyqUElmE TxjDjeuolm0w8V9QIV0YEhDTV/rzEbnmd9oOzeifVZH6WBN2LPTJzo6Dm0Xkaqps5dJz aduDhYaoPSSw8JR7Tmv/337p8zse1I28zQhUC+2oDAi+lMFr2kEc8avcvcz4dTUyY3gR tCJQ== X-Gm-Message-State: AKwxytfOZefPyo8hCw/2mTWpB/ZrRpQZlrJrM2OyY3bjSl2EGDqDhQUM SgbHGlAzZiH+QuaW1A9M8vBQQuJNAZn//4DhUbiu8+Yg X-Google-Smtp-Source: AH8x224b/JIMzn1Fs2PZz3/pnejwN+Wy/SAzGP6C8YIDv7P6cARbvPsKWq9qkSQ9y4FH1LpLf/UGb/r0+VGC8y0dE9w= X-Received: by 10.80.215.146 with SMTP id w18mr54773026edi.208.1517364671643; Tue, 30 Jan 2018 18:11:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.134.56 with HTTP; Tue, 30 Jan 2018 18:11:10 -0800 (PST) From: Ian Lance Taylor Date: Tue, 30 Jan 2018 18:11:10 -0800 Message-ID: Subject: Go patch committed: Function_type and Backend_function_type are not identical To: gcc-patches , gofrontend-dev@googlegroups.com This patch by Cherry Zhang fixes the Go frontend so that Function_type and Backend_function_type are not identical, since they have different backend representations. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 257171) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -bbce8a9af264b25c5f70bafb2ce95d4fed158d68 +a347356d0f432cafb69f0cc5833d27663736a042 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/types.cc =================================================================== --- gcc/go/gofrontend/types.cc (revision 257069) +++ gcc/go/gofrontend/types.cc (working copy) @@ -4442,6 +4442,9 @@ Function_type::is_identical(const Functi Cmp_tags cmp_tags, bool errors_are_identical, std::string* reason) const { + if (this->is_backend_function_type() != t->is_backend_function_type()) + return false; + if (!ignore_receiver) { const Typed_identifier* r1 = this->receiver(); Index: gcc/go/gofrontend/types.h =================================================================== --- gcc/go/gofrontend/types.h (revision 257069) +++ gcc/go/gofrontend/types.h (working copy) @@ -2074,6 +2074,11 @@ class Function_type : public Type Btype* get_backend_fntype(Gogo*); + // Return whether this is a Backend_function_type. + virtual bool + is_backend_function_type() const + { return false; } + protected: int do_traverse(Traverse*); @@ -2167,6 +2172,12 @@ class Backend_function_type : public Fun : Function_type(receiver, parameters, results, location) { } + // Return whether this is a Backend_function_type. This overrides + // Function_type::is_backend_function_type. + bool + is_backend_function_type() const + { return true; } + protected: Btype* do_get_backend(Gogo* gogo)