From patchwork Thu Jun 8 18:42:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 773422 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3wkDmz65tnz9s78 for ; Fri, 9 Jun 2017 04:42:26 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="q11pODOW"; dkim-atps=neutral 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=aH23KUEP+pHrifqzzFGwD0cB2PeQkFvhJ5euMfaFw2kom/ JyGtC3ZEWK5Gv37LNmfQgZZWHtmrhwVdGFlzca7uZaTVgihPR3riIbUTjT3+qpuV wPjygCHTo2+muqr4pjJRGs6jLAn+3ZTTh81rQm4N28LViduaNu0+sKtE9fFBg= 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=E0q2rTbrmV4t3ztzbMs3/uw91co=; b=q11pODOWSuG1UxdBrYMK DO/QF6tFfzosEdwY8v9ul9MJJy8vNqvFB7p4O80BaMABH3+Ywip9D1Ie45CS/6xJ MLLmp3n5tFvZIeZQv02Uh67aFlxSpJR/k7bvkQg/RtTudcEJ8jjMmDyC4sYGvD5m ZuEsTZoFvDrmpWNp1IBbM5U= Received: (qmail 90169 invoked by alias); 8 Jun 2017 18:42:11 -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 90153 invoked by uid 89); 8 Jun 2017 18:42:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 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= X-HELO: mail-ot0-f180.google.com Received: from mail-ot0-f180.google.com (HELO mail-ot0-f180.google.com) (74.125.82.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Jun 2017 18:42:08 +0000 Received: by mail-ot0-f180.google.com with SMTP id t31so28025519ota.1 for ; Thu, 08 Jun 2017 11:42:13 -0700 (PDT) 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=WlyH22G4LkOMv/RNyW8mAxzPrSAMuNzJpyPDe/pjFJI=; b=s4An2v8x37KEc84bnZ07PLIsTORw9nBNprL93AkvxhxpgHgUh8u+BANbQVgLzd/5EN 8guuhzc8cCiclKY1D5t2kcg4J27IpolrPBSe+pjb+Xz23tpb38CfBLcKVZe9Xnoi2bsN +I5Mav51ScvHN7gka2pMA0OTVEupUPg/Phz6n6uZqWBZI8frcyqovL/dqjotP6hZFbqa 7X6AGHrbTxxuAuN8d6/oSo4sR8zkXfoZv58wbO/M6kemt9B+IPobCvCPjjl94Dm+RPHX NDgUFOU5zvahBzKtaSc2lxwIejJ73ghsP4elBSu1XLwM2Fek+RsGecMP4Gno0fvdwtDk p4fg== X-Gm-Message-State: AODbwcClPrmWgIsbBjC7vLSti/ILYipfaXMB0bK7lKOii/TsVOmZ8RDh AgxkOfK7iYKijbgPOt4n/ZRigjsSDk2ShlA= X-Received: by 10.157.15.174 with SMTP id d43mr24023433otd.17.1496947331605; Thu, 08 Jun 2017 11:42:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.207.77 with HTTP; Thu, 8 Jun 2017 11:42:11 -0700 (PDT) From: Ian Lance Taylor Date: Thu, 8 Jun 2017 11:42:11 -0700 Message-ID: Subject: Go patch committed: lvalue context fixes in Unary_expression::do_get_backend To: gcc-patches , "gofrontend-dev@googlegroups.com" In the Go frontend a couple of the Backend::var_expression invocations in Unary_expression::do_get_backend were selecting "lvalue" context incorrectly (these var exprs were not in an assignment or LHS position). This patch by Than McIntosh fixes the problem by changing them back to "rvalue" context. 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 249028) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -4b857cde45939f0e9f3cf89b9e347b6f6ebe0f8f +81d9f6d05c2bb92b2b3af02807713b6bed9bf053 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/expressions.cc =================================================================== --- gcc/go/gofrontend/expressions.cc (revision 249028) +++ gcc/go/gofrontend/expressions.cc (working copy) @@ -4370,7 +4370,7 @@ Unary_expression::do_get_backend(Transla gogo->backend()->implicit_variable_set_init(implicit, buf, btype, true, copy_to_heap, false, bexpr); - bexpr = gogo->backend()->var_expression(implicit, VE_lvalue, loc); + bexpr = gogo->backend()->var_expression(implicit, VE_rvalue, loc); // If we are not copying a slice initializer to the heap, // then it can be changed by the program, so if it can @@ -4380,7 +4380,7 @@ Unary_expression::do_get_backend(Transla && this->expr_->type()->has_pointer()) { Bexpression* root = - gogo->backend()->var_expression(implicit, VE_lvalue, loc); + gogo->backend()->var_expression(implicit, VE_rvalue, loc); root = gogo->backend()->address_expression(root, loc); Type* type = Type::make_pointer_type(this->expr_->type()); gogo->add_gc_root(Expression::make_backend(root, type, loc)); @@ -4400,7 +4400,7 @@ Unary_expression::do_get_backend(Transla true, false, btype, loc); gogo->backend()->immutable_struct_set_init(decl, buf, true, false, btype, loc, bexpr); - bexpr = gogo->backend()->var_expression(decl, VE_lvalue, loc); + bexpr = gogo->backend()->var_expression(decl, VE_rvalue, loc); } go_assert(!this->create_temp_ || this->expr_->is_variable());