From patchwork Wed Jan 5 00:08:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 77551 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 80EB8B711C for ; Wed, 5 Jan 2011 11:08:25 +1100 (EST) Received: (qmail 30828 invoked by alias); 5 Jan 2011 00:08:19 -0000 Received: (qmail 30810 invoked by uid 22791); 5 Jan 2011 00:08:13 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Jan 2011 00:08:09 +0000 Received: from kpbe14.cbf.corp.google.com (kpbe14.cbf.corp.google.com [172.25.105.78]) by smtp-out.google.com with ESMTP id p05087G9007154 for ; Tue, 4 Jan 2011 16:08:07 -0800 Received: from iwr19 (iwr19.prod.google.com [10.241.69.83]) by kpbe14.cbf.corp.google.com with ESMTP id p05086HW029600 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Tue, 4 Jan 2011 16:08:06 -0800 Received: by iwr19 with SMTP id 19so15796896iwr.23 for ; Tue, 04 Jan 2011 16:08:06 -0800 (PST) Received: by 10.231.38.2 with SMTP id z2mr6260338ibd.142.1294186085935; Tue, 04 Jan 2011 16:08:05 -0800 (PST) Received: from coign.google.com (dhcp-172-22-123-229.mtv.corp.google.com [172.22.123.229]) by mx.google.com with ESMTPS id gy41sm20271587ibb.11.2011.01.04.16.08.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 16:08:05 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Don't call __builtin_return_address (1) Date: Tue, 04 Jan 2011 16:08:03 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true 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 The function runtime.Caller is not properly implemented in gccgo. In the dummy implementation, I accidentally called __builtin_return_address with an argument of 1 rather than 0. That fails to compile on two targets. This patch fixes that problem. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. This should fix PR's 46958 and 46965. Committed to mainline. Ian diff -r 5f4f01af0140 libgo/runtime/go-caller.c --- a/libgo/runtime/go-caller.c Tue Jan 04 15:29:15 2011 -0800 +++ b/libgo/runtime/go-caller.c Tue Jan 04 16:02:55 2011 -0800 @@ -31,7 +31,7 @@ /* A proper implementation needs to dig through the debugging information. */ - ret.pc = (uint64_t) (uintptr_t) __builtin_return_address (1); + ret.pc = (uint64_t) (uintptr_t) __builtin_return_address (0); ret.file.__data = NULL; ret.file.__length = 0; ret.line = 0;