From patchwork Fri Jun 13 13:50:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 359549 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 9446E1400EA for ; Fri, 13 Jun 2014 23:50:28 +1000 (EST) 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:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=QmQTFSmoWcpBLaa25oLXk+Nvl/n1ALStcK9YVthjMYGVpd+GIVrUw wQouGBPu0q0MxaKL8nv5+by/Del68Cv+SulRJ9At7H1XjPOo09Ne4oGGyfnR0snQ CvPDKrN4sgbW+RrCsFVd96EpWcS6md8IlfH2M/ugMb5MruXflvzqs0= 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:subject:date:message-id:mime-version:content-type; s= default; bh=36WokinZTuhgzDpLfJ+AyAwJD7U=; b=PJSsm4ip2KsBjzqNTiNw eyPmKrcBnQ5uxXkedYdQvFdBwAKyvlAeWDH+ZwhsrFMNeKgqCumPP8FXjTM6vCYQ g8G58V92RfXUYKHg7LbaiJYxANp6RypP8OpFu2aw+l9VwFR/+L/iAd2e5TGYU+dD nO3duWXae+QHU51cndplqqg= Received: (qmail 32546 invoked by alias); 13 Jun 2014 13:50:21 -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 32535 invoked by uid 89); 13 Jun 2014 13:50:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS, T_TVD_MIME_NO_HEADERS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f175.google.com Received: from mail-pd0-f175.google.com (HELO mail-pd0-f175.google.com) (209.85.192.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 13 Jun 2014 13:50:20 +0000 Received: by mail-pd0-f175.google.com with SMTP id v10so1272874pde.6 for ; Fri, 13 Jun 2014 06:50:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=iFnhU9n+If8ygDIctJBJJj0HYS1BrhSrfyd1iE6RmME=; b=Ji6BoWemwj0qkt70GE4MrJqnkHW7nYUr41tK81PF1MFrgRpJ1LYK2CxG3ZgIAc696j p6yusBTIqHL3Z41bh30zdPqnAZnlhjKpxKHdcnw9vBely/uuyYXqL0z1IGJlBtpd+sDC MgSvMNze+XA/hByZMdO0GnPfbX7AzAyETMTIIxfj2wEsu22H2xK73SI/wMN4flMmFHSy qvEjPGID6OAeLkPY3XxcS6mDWdmdGjK3yJ7vKYPNOsh4UwLA5uGVNcFyryAKJQo0G5A/ 3YL8OwoEPYnCMaTSyVoZ5aMUUR03Cc4PHZ4gI24fNqeGvGajpAAPhHiMMVCGwGsFE9N1 64zQ== X-Gm-Message-State: ALoCoQkUN3I+DhdTtAf2EnlcC2x1a0+cnifg0MP6ODXQdqZq7anN3Pc9fwKQzTzWlFsn402Y+Wi5 X-Received: by 10.68.133.163 with SMTP id pd3mr3498879pbb.166.1402667418559; Fri, 13 Jun 2014 06:50:18 -0700 (PDT) Received: from iant-glaptop.roam.corp.google.com.google.com ([207.198.105.20]) by mx.google.com with ESMTPSA id zb2sm3790502pbb.45.2014.06.13.06.50.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Jun 2014 06:50:17 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: libgo patch committed: Align stack bottom pointer for GC Date: Fri, 13 Jun 2014 06:50:14 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes This patch to libgo: always sets gcnext_sp to a pointer-aligned address. The gcnext_sp field is only used on systems that do not use split stacks. It marks the bottom of the stack for the garbage collector. This change makes sure that the stack bottom is always aligned to a pointer value. Previously the garbage collector would align all the addresses that it scanned, but it now expects them to be aligned before scanning. This should fix PR go/61498. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r 07d3bcf45181 libgo/runtime/proc.c --- a/libgo/runtime/proc.c Mon Jun 09 17:35:15 2014 -0700 +++ b/libgo/runtime/proc.c Fri Jun 13 06:45:38 2014 -0700 @@ -255,9 +255,6 @@ { M *mp; G *gp; -#ifndef USING_SPLIT_STACK - int i; -#endif // Ensure that all registers are on the stack for the garbage // collector. @@ -273,7 +270,7 @@ #ifdef USING_SPLIT_STACK __splitstack_getcontext(&g->stack_context[0]); #else - gp->gcnext_sp = &i; + gp->gcnext_sp = &pfn; #endif gp->fromgogo = false; getcontext(&gp->context); @@ -1933,7 +1930,7 @@ &g->gcinitial_sp); #else { - uint32 v; + void *v; g->gcnext_sp = (byte *) &v; }