From patchwork Thu Jun 22 18:09:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 779665 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 3wtqP74NnMz9sDB for ; Fri, 23 Jun 2017 04:10:02 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="bSrksdA0"; 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:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=fYPd+krykJlJ4eHf Agoel9ScxrnVrejxOs58poyP2Qszndq7imzNqQF+gLPEo+H7qwwUwEorLa7qpi9b 4lPCyWxW0hOgTFTu73VG3aJVYjNZCq7RGmJ5tgOG97vfnv+ZZLoZN4oDxAL4goWa 4925RoJg/yDx09jO8Jlh+nAqOAY= 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:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=oXR3VhJs28S+GAeymbEVgS Qt1oA=; b=bSrksdA0xACfkGMxEMp898OGyiabvbbSf9HlHdmXpDIFCElVvEwvCZ jjTbX2hFoy0ep7fkbtFVFHGniFvkNgzElMTRqWbhNpQWLcibbepuXpI1Si319kJU g7cAwEsxhMfGdSA9EdorUgz0nnf/J9wn9g/joOvzweFYjPCeTsFjA= Received: (qmail 116090 invoked by alias); 22 Jun 2017 18:09:53 -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 115163 invoked by uid 89); 22 Jun 2017 18:09:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-19.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=8:te, 8:=a2, 8:ca, 8:ll?= X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Jun 2017 18:09:50 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 88EBB3FB; Thu, 22 Jun 2017 20:09:48 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5jY3NIPc18+l; Thu, 22 Jun 2017 20:09:46 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p5DCE0385.dip0.t-ipconnect.de [93.206.3.133]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 441183FA; Thu, 22 Jun 2017 20:09:46 +0200 (CEST) From: Rainer Orth To: Ian Lance Taylor Cc: gcc-patches , "gofrontend-dev\@googlegroups.com" Subject: Re: libgo patch committed: Change some stack fields to uintptr References: Date: Thu, 22 Jun 2017 20:09:45 +0200 In-Reply-To: (Ian Lance Taylor's message of "Thu, 22 Jun 2017 07:44:36 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Hi Ian, > Because of how gccgo implements cgo calls, the code in dropm may not > have any write barriers. As a step toward implementing that, change > the gcstack, gcnextsegment, and gcnextsp fields of the g struct to > uintptr, so that assignments to them do not require write barriers. > The gcinitialsp field remains unsafe.Pointer, as on 32-bit systems > that do not support split stack it points to a heap allocated space > used for the goroutine stack. > > The test for this is runtime tests like TestCgoCallbackGC, which are > not run today but will be run with a future gotools patch. > > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed > to mainline. this patch broke bootstrap on non-split-stack targets like Solaris: /vol/gcc/src/hg/trunk/local/libgo/runtime/proc.c: In function âdoentersyscallblockâ: /vol/gcc/src/hg/trunk/local/libgo/runtime/proc.c:681:15: error: assignment makes integer from pointer without a cast [-Werror=int-conversion] g->gcnextsp = (byte *) &v; ^ The patch below allowed sparc-sun-solaris2.12 and i386-pc-solaris2.12 builds to finish. Rainer diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c --- a/libgo/runtime/proc.c +++ b/libgo/runtime/proc.c @@ -678,7 +678,7 @@ doentersyscallblock(uintptr pc, uintptr { void *v; - g->gcnextsp = (byte *) &v; + g->gcnextsp = (uintptr)(&v); } #endif