Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 May 2003 11:08:07 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        freebsd-ia64@freebsd.org
Subject:   Re: (FWD) Does gcc violate the ia64 ABI?
Message-ID:  <20030530180807.GD568@dhcp01.pn.xcllnt.net>
In-Reply-To: <20030530173827.GD90937@dragon.nuxi.com>
References:  <20030530173827.GD90937@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 30, 2003 at 10:38:27AM -0700, David O'Brien wrote:
> ----- Forwarded message from "H. J. Lu" <hjl@lucon.org> -----
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030530180807.GD568>