This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
> 
> 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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]