From patchwork Fri Jul 13 18:25:29 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: 943757 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-481544-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=golang.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="E5d+GnEg"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=golang-org.20150623.gappssmtp.com header.i=@golang-org.20150623.gappssmtp.com header.b="ObTeQXxu"; 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 41S1TG1lhkz9s2x for ; Sat, 14 Jul 2018 04:25:52 +1000 (AEST) 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=UovHlAIEzh2lonBLNTkFo70r0M+flhAxF2iA6L/HL/LtnH njDszOs0eA16u0o58KlZrVKHL8C9BmTgTyx7qIwVyWTZQpO/mmJKS6+LIt7eZt7e HhCnHy6tz3ffpubddXH8LdaDLUYDXuuMeba1ZwMpXlg2a4aADfMzZQYq9oKEA= 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=oVmgwk62+FeWWwre4I9anrnh+Yg=; b=E5d+GnEgxSg6ZikT3Z+T xH/7+gEBxJA4+XeLkFnUE4EU/zNSgFwQyF/KrDBBZFfLBuDCmjnf2NDz+Rz9n2JN 0WKKaRGb03akF2mAJ+kW1HWplcCNSrrvbFv7aY/hc0oi58NgiNovRqXtBFPB8Pcz b0Faxs4+ksDlJ2hPWh/S15U= Received: (qmail 50004 invoked by alias); 13 Jul 2018 18:25:45 -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 49826 invoked by uid 89); 13 Jul 2018 18:25:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.6 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=Hx-languages-length:1359, sk:267686f, 262554 X-HELO: mail-lf0-f51.google.com Received: from mail-lf0-f51.google.com (HELO mail-lf0-f51.google.com) (209.85.215.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Jul 2018 18:25:32 +0000 Received: by mail-lf0-f51.google.com with SMTP id m12-v6so27892931lfc.10 for ; Fri, 13 Jul 2018 11:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golang-org.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=DUTT3+0PQqJuBTa5JbwOpTd6XZaueHIIsyPKcsOjoEM=; b=ObTeQXxunkQC8aiNykH/yqNmoH+nG+4bRsg7IKNB4OzoiPu5xJg5wHwBd3QWviNedq WERAgDP1DpMTVfBglY1s7O6WiMV8hCDVMopv8XuPgQ/7UpH+0+J8L4XwkwJLAlvT9W/d KxqUOFxLMuykK4ltC5KndgfM0Dyi6gv71HhlH2Oyub4rOV47AKtTSmtt8X6Nyg/bYnHR jUpUMzh7GfpYdzhfR/4HcbGDMcF2RMKjZxhyP3yOt07Tqo4Kf6/Feb/+J+jnZmd6Oobr 9OE9jq2Rt1USWWUZ9Y8X66EzZmIarFd5T+KOWBPH9RgxT7NTe55j+ej2IOEQJgLuG654 KzbA== MIME-Version: 1.0 Received: by 2002:ab3:1d07:0:0:0:0:0 with HTTP; Fri, 13 Jul 2018 11:25:29 -0700 (PDT) From: Ian Lance Taylor Date: Fri, 13 Jul 2018 11:25:29 -0700 Message-ID: Subject: Go patch commited: Fix parsing of composite literals with omitted pointer types To: gcc-patches , gofrontend-dev@googlegroups.com This patch to the Go frontend fixes parsing of composite literals with omitted pointer types. The frontend could parse omitted pointer typess at the end of the type, but not in the middle, so code like []*[][]int{{{1}}} failed. A test case is in https://golang.org/cl/123477. This fixes https://golang.org/issue/26340. 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 262572) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -267686fd1dffbc03e610e9f17dadb4e72c75f18d +3f7e72eca3f9221e67c055841d42851aa6a66aff 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 262554) +++ gcc/go/gofrontend/expressions.cc (working copy) @@ -13666,6 +13666,7 @@ Composite_literal_expression::do_lower(G for (int depth = 0; depth < this->depth_; ++depth) { + type = type->deref(); if (type->array_type() != NULL) type = type->array_type()->element_type(); else if (type->map_type() != NULL)