From patchwork Mon Sep 9 19:41:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 1159917 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-508723-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="lP+6h+1G"; 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="lDfGJpfP"; 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 46Rz7S1GWvz9s4Y for ; Tue, 10 Sep 2019 05:41:37 +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=dTbFWm8K2PPd+dzwE9WMZWKdp7ZuVVnkbnL0PiruhDTMEM m1XX822KBVhlrt7QoXIzHxnySWH/f2Dt7HDtz8iUDoOyuHVIyX4xXIwiHBwb08Yl QUgLLxeNElz37mBDF1KssALHWOu2ThqUhw8Ys4US/fYYUfiSNQvoPL7ZXJpSE= 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=zSdzaxkAUZMEZYM7vaC8vWhFRfM=; b=lP+6h+1Gnl51yW+VKVDk 1dFOgecNgrtm1CYCJMSZg3Z2Yn4zRmHXdYUpJm6aH0un9rT91McQk99ge/MGqopz CL7eF6uCSQVH85ANBoBnFDJC175+QJO5PxSMaLCI/e9Vpj7IdyIb858b03S6mHFV GOZfpp8Hff6q8BqN633Jj/Y= Received: (qmail 67029 invoked by alias); 9 Sep 2019 19:41:30 -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 67021 invoked by uid 89); 9 Sep 2019 19:41:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.8 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.1 spammy=Every, HX-Languages-Length:1603 X-HELO: mail-lf1-f54.google.com Received: from mail-lf1-f54.google.com (HELO mail-lf1-f54.google.com) (209.85.167.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 19:41:29 +0000 Received: by mail-lf1-f54.google.com with SMTP id c12so11480337lfh.5 for ; Mon, 09 Sep 2019 12:41:28 -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=WmJ41YCaGlFbLqtzT1SCfIZIEF19OzGzk/20h95lU+I=; b=lDfGJpfPHbUqe9ujfzOoEo59e1QmFR4WsUoK4Kdu35XPwcm98GTrDG4Msvy8k+Wkuv TY4T3uh+HmRztXsuOJBz+1i6NchiydqrxFUcoaFoiprUQkw0buuaVtVWGHEF132dYpKO MDcPEiy3bEGs9rzR7yzeHp3HTkC5dOgHA0ZZd679OZ4B4cHHzOv4uBoCP4z4+amvwVe1 DUkMZl3GBUv1XduWFIipXlJ5aQQZIhF9pe2kGbYq9jobdXekOZld3O5NMW0jnjx/ZtDm T4BWs5YF9QKtqtarmx/HoXadJkqKv8yp/9nfC+lcUoGdIKcoGPrds00HtQjBMIMvXH+d Lk6g== MIME-Version: 1.0 From: Ian Lance Taylor Date: Mon, 9 Sep 2019 12:41:15 -0700 Message-ID: Subject: Go patch committed: Don't use predeclared location for implicit runtime import To: gcc-patches , gofrontend-dev In the Go frontend, for the main package, we add an implicit import of the runtime package, to ensure that it is initialized. That import used the predeclared location, which caused various tests, notably Named_type::is_builtin, to treat these imported names as builtin. Start using a real location, so that those tests do the right thing. 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 275539) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -28c9053b3d507bef7bd56cb01c6b22deea354cdd +17bef47f464983fd8513f88f3f159d28e2423e79 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/gogo.cc =================================================================== --- gcc/go/gofrontend/gogo.cc (revision 275396) +++ gcc/go/gofrontend/gogo.cc (working copy) @@ -2589,9 +2589,11 @@ Gogo::define_global_names() if (this->is_main_package()) { // Every Go program has to import the runtime package, so that - // it is properly initialized. + // it is properly initialized. We can't use + // predeclared_location here as it will cause runtime functions + // to appear to be builtin functions. this->import_package("runtime", "_", false, false, - Linemap::predeclared_location()); + this->package_->location()); } for (Bindings::const_declarations_iterator p =