Does gcc violate the ia64 ABI?
John David Anglin
dave@hiauly1.hia.nrc.ca
Fri May 16 23:37:00 GMT 2003
> 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
>
> H.J.
> --x.c-
> extern void foo ();
>
> void
> 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.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
More information about the Gcc
mailing list