From patchwork Thu May 24 20:45:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 161202 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]) by ozlabs.org (Postfix) with SMTP id C5AB2B6F86 for ; Fri, 25 May 2012 06:46:00 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1338497162; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Subject:Date:Message-ID:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=8RjB/Bd7+5p1uextWwGSPFo1AdY=; b=jUSwJhm8HsW5OUl SLcCvOvbi6j/rTWxNnDy3DRnWVMxrIG2EamZFwtuGTvqf5k4V5T3PyfMfgQB8b+r kvjv6vXSqdDybcsbopm0g+t+mHIWp1iv5rMU2Kdo4rqOjmZasD0hGjLyONrDcGVx 8mv86+0Lbh8CGeRRm2ivCl+XuF8o= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=aLUsn61A+CiK4IMEpeR9xyW1hK/BZBbWX8YjaVRO+qHwMhKQOiG/1UDlYJNySk R3AlAtbaFqa19bcKAlGl4/Xa6dIsOVMnX7JRXdP3Zq0xBGsEoezaX+d3Awb47enH AffaXQME0mDD+1F08NXDlv4NGFhJprbMcjKOs8Ja/tuXk=; Received: (qmail 16898 invoked by alias); 24 May 2012 20:45:57 -0000 Received: (qmail 16888 invoked by uid 22791); 24 May 2012 20:45:56 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-gh0-f175.google.com (HELO mail-gh0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 May 2012 20:45:43 +0000 Received: by ghbz2 with SMTP id z2so150598ghb.20 for ; Thu, 24 May 2012 13:45:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=TmtsG6VNhhSV13a4//kdX/ZWdTScDXnQ9gUORAHc9YA=; b=g4TdjfEicxEOtD1em2OQmGOjNL8TNbrfLivnIgSS9huRwhv/vkQhnNz/HYbjrwfVJt fWjs7CcCEDOhxAQ0VRFoBBltd7CCRyO0xM3lC6NiSRvA/wS3lx4o1Cy3uK3WohRUEcUd b/3hTBf+K9oWujDozSdRUh8CwQgdSfsCaaMZdDL7Le2f7mPq1pAhERTNZ2QZKTz8IkRV 9HHPR4rJ5PNwXmo2r8Zq7gJGGtoAVzaho+LSn1aiMjYOBzOhcT72BwlYIqBJ3OW2ynFO ZsjcxUHl/kZQOpyhfDFjQVp6FO+skNW+rCMqSFhnF7o2z5xp/jmO0lxblvb6uAL1cofM Ayvg== Received: by 10.42.142.71 with SMTP id r7mr678445icu.7.1337892342804; Thu, 24 May 2012 13:45:42 -0700 (PDT) Received: by 10.42.142.71 with SMTP id r7mr678434icu.7.1337892342638; Thu, 24 May 2012 13:45:42 -0700 (PDT) Received: from coign.google.com ([72.14.225.65]) by mx.google.com with ESMTPS id gg6sm16170929igb.5.2012.05.24.13.45.41 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 May 2012 13:45:41 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: libgo patch committed: Copy runtime_printf from other library Date: Thu, 24 May 2012 13:45:39 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQk2cc6LD2t0VOESLhfVUKlDv3DpPmgfIe2NOPI9jQfUIFz3vddTaqN8q0dl48+Hi9bscyzBzZJz4UQzSKrMGvjkzGwv+unp2vfFZF5o5ud9hHnjSzu15fhCeqLpuQWWoXprWiHesOgpWRzK5s/kdrnwbE9fPg== X-IsSubscribed: yes 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 This patch to libgo copies the implementation of runtime_printf from the other Go library, and use that instead of calling the C library printf function. This removes some unnecessary differences in shared files, and removes some unnecessary stack splits. However, the main reason I'm doing it is to pick up the support for sending the printf output into a goroutine-specific buffer, used to implement runtime.Stack, coming up next. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and 4.7 branch. Ian diff -r d99f020243e7 libgo/runtime/go-callers.c --- a/libgo/runtime/go-callers.c Tue May 22 09:54:14 2012 -0700 +++ b/libgo/runtime/go-callers.c Tue May 22 14:50:06 2012 -0700 @@ -72,5 +72,8 @@ int Callers (int skip, struct __go_open_array pc) { - return runtime_callers (skip, (uintptr *) pc.__values, pc.__count); + /* In the Go 1 release runtime.Callers has an off-by-one error, + which we can not correct because it would break backward + compatibility. Adjust SKIP here to be compatible. */ + return runtime_callers (skip - 1, (uintptr *) pc.__values, pc.__count); }