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: Accessing IP on IA-64 with RTL


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
        called _mcount
    in1 gp value to restore before returning to the function that
        called _mcount
    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))

or 

	(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?


r~


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