Subject: Re: %g registers
To: None <>
From: Valeriy E. Ushakov <>
List: port-sparc
Date: 12/01/2002 18:40:38
On Sun, Dec 01, 2002 at 14:35:52 +0100, Michael Rauch wrote:

> > der> Which %g registers can I count on not changing behind my back?
> > It's defined by the Sparc ABI. [...]
> the complete text is in "The SPARC Architecture Manual, Version 8":
>, Appendix D. 

And the problem is that gcc clobbers app registers.

     Specify `-mapp-regs' to generate output using the global registers
     2 through 4, which the SPARC SVR4 ABI reserves for applications.
     This is the default.
     To be fully SVR4 ABI compliant at the cost of some performance
     loss, specify `-mno-app-regs'.  You should compile libraries and
     system software with this option.

And some handwritten assembler routines in libc still use %g2..%g4.

SY, Uwe
--                         |       Zu Grunde kommen            |       Ist zu Grunde gehen