(FWD) Does gcc violate the ia64 ABI?

Marcel Moolenaar marcel at xcllnt.net
Fri May 30 11:08:08 PDT 2003


On Fri, May 30, 2003 at 10:38:27AM -0700, David O'Brien wrote:
> ----- Forwarded message from "H. J. Lu" <hjl at 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 at xcllnt.net


More information about the freebsd-ia64 mailing list