This is the mail archive of the
mailing list for the GCC project.
Re: Accessing IP on IA-64 with RTL
- From: Richard Henderson <rth at redhat dot com>
- To: Steve Ellcey <sje at cup dot hp dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 25 Jan 2005 17:49:06 -0800
- Subject: Re: Accessing IP on IA-64 with RTL
- References: <200501260113.RAA05908@hpsje.cup.hp.com>
On Tue, Jan 25, 2005 at 05:13:03PM -0800, Steve Ellcey wrote:
> I am not sure why GCC is passing r1 instead of ip but when I change r1
> to ip by hand in the assembly file the HP prof and gprof commands seem
> to give better information then they do when given r1.
Because the glibc mcount uses it.
State upon entering _mcount:
r8 address of return value structure (used only when called
function returns a large structure)
r15 static link (used only for nested functions)
in0 ar.pfs to restore before returning to the function that
in1 gp value to restore before returning to the function that
in2 return address in the function that invoked the caller
of _mcount (frompc)
in3 address of the global-offset table entry that holds the
profile count dword allocated by the compiler; to get
the address of this dword, use "ld8 in2=[in2]; this
dword can be used in any way by _mcount (including
not at all, as is the case with the current implementation)
b0 address to return to after _mcount is done
> My question is: how do I access ip from GCC using RTL?
I suggest using either
(set (reg:DI reg) (pc))
(set (reg:DI reg) (unspec:DI [(const_int 0)] IP))
but neither of these pin a specific ip value. What does the HP _mcount
use this for? What's different about this value than the b0 value that
it gets from the call instruction?