From patchwork Thu Sep 24 13:33:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 522340 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 C782714017E for ; Thu, 24 Sep 2015 23:33:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ZUfZSbzf; 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:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=j+zvaAg48LI5+ifIvm 2iswHtHzQnWOgiQYloegheX9GMGGB3mIIakAsZXl72UZDR32gtTcZTsepoVIkt8o 33UUOTGfklI4g+LD6WI7XsIfrSTw8pUlUlt1Y8aBWv5Hz9DaT6nPGCyoxtGam7fN vYdrJAQI3bk7PnXQhzckW+Nsc= 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:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=OblpRHR0cO7qbq9wWv6x08qC pw0=; b=ZUfZSbzfh9noUdpSV5YKrlzzFvSSKV0MWc0VsizNdJSQbdimFctHwV0K wCh68V25DW5RHUfko9TOTxLmfZRXT+iUpY+ypVF7vHQHD7Mp1hijrbvWuDZh4jv8 AlRdd2ywfx6u9YQXZHrVYzCbaz4lWY4TB9VKWcfu1qDNCNSaquk= Received: (qmail 37169 invoked by alias); 24 Sep 2015 13:33:36 -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 37157 invoked by uid 89); 24 Sep 2015 13:33:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_50, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ig0-f182.google.com Received: from mail-ig0-f182.google.com (HELO mail-ig0-f182.google.com) (209.85.213.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 24 Sep 2015 13:33:33 +0000 Received: by igbni9 with SMTP id ni9so48837166igb.0 for ; Thu, 24 Sep 2015 06:33:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=YdeT4SvjjBks5LNoTC3BMnp+lAQxTA5Yau2hvqFwK6Q=; b=c/9zIJOeJ0UiH797I6jK/UNmL0l+qh+VLx56OoRSoTiNlLuTHGgKM0ewRToJo8lZWq ztQR2BWSuFp/+7LTLuIPIBDVRBFGlncDKj2Pm4j/RZ75JKFjJONxAwPQ7udz2gIXbAHG KqT+At6exLEX1olgMc58DHYzHDIECIzU5zLvC0HYo1dsz8Dvo8fWjwnmn3NjDrCBFyAX QayvS+3IfsaPkE+bsmgT1G3no7oEEMy4GVGd7fqMRrjsdHuCu5w5m5IPV+2QI07tQbhR DAu9gwTdpHWfgIBzZ8aCewvJy5lcZWtNDbq3ARYjhGj1EjVMDfmd3Lr7NGbObRnHbt/X nOBw== X-Gm-Message-State: ALoCoQmrm8ksXUSmW0JqQoS4pCl21KpACwtX+O054Go6ie0zjMb4V33cBBWn0ms0yQFtyoSF0mOp MIME-Version: 1.0 X-Received: by 10.50.6.16 with SMTP id w16mr522963igw.74.1443101611457; Thu, 24 Sep 2015 06:33:31 -0700 (PDT) Received: by 10.79.102.133 with HTTP; Thu, 24 Sep 2015 06:33:31 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 Sep 2015 06:33:31 -0700 Message-ID: Subject: Re: libgo patch committed: rewrite lfstack to look more like gc code From: Ian Lance Taylor To: Rainer Orth Cc: gcc-patches , "gofrontend-dev@googlegroups.com" , Michael Hudson-Doyle On Thu, Sep 24, 2015 at 6:25 AM, Rainer Orth wrote: > Ian Lance Taylor writes: > >> This patch by Michael Hudson-Doyle rewrites the lfstack code in libgo >> to look more like that in the gc library. It also fixes it for arm64. >> Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. >> Committed to mainline. > > This patch broke Solaris/x86 bootstrap: the amd64 lfstack.goc fails to > compile: > > $ /bin/ksh ./libtool --tag=CC --mode=compile /var/gcc/gcc-6.0.0-20150924/12-gcc/./gcc/xgcc -B/var/gcc/gcc-6.0.0-20150924/12-gcc/./gcc/ -B/usr/local/i386-pc-solaris2.12/bin/ -B/usr/local/i386-pc-solaris2.12/lib/ -isystem /usr/local/i386-pc-solaris2.12/include -isystem /usr/local/i386-pc-solaris2.12/sys-include -m64 -DHAVE_CONFIG_H -I. -I/vol/gcc/src/hg/trunk/solaris/libgo -I /vol/gcc/src/hg/trunk/solaris/libgo/runtime -I/vol/gcc/src/hg/trunk/solaris/libgo/../libffi/include -I../libffi/include -pthread -fexceptions -fnon-call-exceptions -fplan9-extensions -Wall -Wextra -Wwrite-strings -Wcast-qual -Werror -minline-all-stringops -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I /vol/gcc/src/hg/trunk/solaris/libgo/../libgcc -I /vol/gcc/src/hg/trunk/solaris/libgo/../libbacktrace -I ../../../gcc/include -g -O2 -MT lfstack.lo -MD -MP -MF .deps/lfstack.Tpo -c -o lfstack.lo lfstack.c > libtool: compile: /var/gcc/gcc-6.0.0-20150924/12-gcc/./gcc/xgcc -B/var/gcc/gcc-6.0.0-20150924/12-gcc/./gcc/ -B/usr/local/i386-pc-solaris2.12/bin/ -B/usr/local/i386-pc-solaris2.12/lib/ -isystem /usr/local/i386-pc-solaris2.12/include -isystem /usr/local/i386-pc-solaris2.12/sys-include -m64 -DHAVE_CONFIG_H -I. -I/vol/gcc/src/hg/trunk/solaris/libgo -I /vol/gcc/src/hg/trunk/solaris/libgo/runtime -I/vol/gcc/src/hg/trunk/solaris/libgo/../libffi/include -I../libffi/include -pthread -fexceptions -fnon-call-exceptions -fplan9-extensions -Wall -Wextra -Wwrite-strings -Wcast-qual -Werror -minline-all-stringops -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I /vol/gcc/src/hg/trunk/solaris/libgo/../libgcc -I /vol/gcc/src/hg/trunk/solaris/libgo/../libbacktrace -I ../../../gcc/include -g -O2 -MT lfstack.lo -MD -MP -MF .deps/lfstack.Tpo -c lfstack.c -fPIC -DPIC -o .libs/lfstack.o > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc:32:22: error: redefinition of 'lfPack' > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc:16:22: note: previous definition of 'lfPack' was here > static inline uint64 lfPack(LFNode *node, uintptr cnt) { > ^ > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc: In function 'lfPack': > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc:33:38: error: 'PTR_BITS' undeclared (first use in this function) > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc:33:38: note: each undeclared identifier is reported only once for each function it appears in > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc: At top level: > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc:35:23: error: redefinition of 'lfUnpack' > return ((uint64)(node)<<(64-PTR_BITS)) | (cnt&(((1< ^ > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc:19:23: note: previous definition of 'lfUnpack' was here > static inline LFNode* lfUnpack(uint64 val) { > ^ > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc: In function 'lfUnpack': > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc:31:26: error: 'PTR_BITS' undeclared (first use in this function) > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc:36:31: note: in expansion of macro 'CNT_BITS' > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc: In function 'lfPack': > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc:34:1: error: control reaches end of non-void function [-Werror=return-type] > static inline uint64 lfPack(LFNode *node, uintptr cnt) { > ^ > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc: In function 'lfUnpack': > /vol/gcc/src/hg/trunk/solaris/libgo/runtime/lfstack.goc:37:1: error: control reaches end of non-void function [-Werror=return-type] > static inline LFNode* lfUnpack(uint64 val) { > ^ > cc1: all warnings being treated as errors > make: *** [lfstack.lo] Error 1 Bother. Sorry about that. Should be fixed with this patch. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 228064) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -90ebe729992443dc00b19c76b28d1270e17245a4 +66c113f1af300ce27b99f18f792901d7327d6699 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/runtime/lfstack.goc =================================================================== --- libgo/runtime/lfstack.goc (revision 228057) +++ libgo/runtime/lfstack.goc (working copy) @@ -29,7 +29,6 @@ static inline LFNode* lfUnpack(uint64 va // So we use 17msb of pointers as ABA counter. # define PTR_BITS 47 # endif -# endif # define CNT_BITS (64 - PTR_BITS + 3) static inline uint64 lfPack(LFNode *node, uintptr cnt) { return ((uint64)(node)<<(64-PTR_BITS)) | (cnt&(((1<> CNT_BITS) << 3); } +# endif #else static inline uint64 lfPack(LFNode *node, uintptr cnt) { return ((uint64)(uintptr)(node)<<32) | cnt;