This is the mail archive of the
mailing list for the GCC project.
Re: Does gcc violate the ia64 ABI?
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc at gcc dot gnu dot org
- Cc: hjl at lucon dot com
- Date: Fri, 16 May 2003 19:37:03 -0400 (EDT)
- Subject: Re: Does gcc violate the ia64 ABI?
> 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?
> # gcc -O2 -S x.c
> extern void foo ();
> bar (void)
> foo ();
As on the PA, I don't believe there is a need to always save and restore
gp. gp isn't used in bar. The caller of bar will restore gp if it
uses gp after calling bar. If bar called foo twice, then gp should
be saved and restored across the first call to foo.
J. David Anglin email@example.com
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)