From owner-freebsd-ia64@FreeBSD.ORG Fri May 30 11:08:08 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85EDC37B401 for ; Fri, 30 May 2003 11:08:08 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAAFA43F85 for ; Fri, 30 May 2003 11:08:07 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h4UI87wk078450 for ; Fri, 30 May 2003 11:08:07 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h4UI874s000814 for ; Fri, 30 May 2003 11:08:07 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h4UI87YC000813 for freebsd-ia64@freebsd.org; Fri, 30 May 2003 11:08:07 -0700 (PDT) Date: Fri, 30 May 2003 11:08:07 -0700 From: Marcel Moolenaar To: freebsd-ia64@freebsd.org Message-ID: <20030530180807.GD568@dhcp01.pn.xcllnt.net> References: <20030530173827.GD90937@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030530173827.GD90937@dragon.nuxi.com> User-Agent: Mutt/1.5.4i Subject: Re: (FWD) Does gcc violate the ia64 ABI? X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2003 18:08:08 -0000 On Fri, May 30, 2003 at 10:38:27AM -0700, David O'Brien wrote: > ----- Forwarded message from "H. J. Lu" ----- > I will open a bug in gcc bugzilla when conversion is done. In the > meantime, I opened > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=91056 > > The problem is gcc doesn't save/store gp across call. According to the > ia64 ABI, callee can change gp and gp must be saved/restore by caller > across calls. It is on page 5-2 in the Itanium Software Conventions > and Runtime Architecture Guide. Am I right? > ----- End forwarded message ----- > > I have put the entire thread at > http://people.freebsd.org/~obrien/gcc-violate-ia64ABI.mbox I don't think gcc violates the runtime. There's no requirement to save and restore gp in a function if that function does not need or use gp itself. Suppose we have the following call-graph: foo->bar->baz foo() cannot assume that when bar() returns, gp has the value that corresponds to bar(). The function bar() can safely call baz() without saving and restoring gp if bar() itself has no reference to gp. I think gp is marked as a scratch register besides the requirement that it is setup by the caller for use by the callee... -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net