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


Steve Ellcey wrote:
It works (modulo the problem reported in PR 12455) but it is not being
called after the prologue.
From config/ia/ia64.h:
	#undef  PROFILE_BEFORE_PROLOGUE
	#define PROFILE_BEFORE_PROLOGUE 1

Yes, we always call it before the prologue on IA-64. Richard was mistaken. Most other linux targets are probably calling it after the prologue nowadays.


If you use PROFILE_HOOK, then yes, it will be called after the prologue. We don't support emitting rtl before the prologue.

If you move the profile after the prologue, you will have to change the calling sequence. The current one assumes we are before the prologue, and creates its own register window for output arguments, which then gets overwritten by the register window created by the prologue. After the prologue, it should look like pretty much like any other function call.

If we do call it after the prologue, that would fix PR 12455.

    7	foo:
    8		.data
    9		.align 8
   10	.LP2:
   11		data8	0
   12		.text
   13		alloc out0 = ar.pfs, 8, 0, 4, 0

Yuck. This should be fixed. We shouldn't be switching sections inside a function. This should use xdata instead of data. Probably better is to define NO_PROFILE_COUNTERS, as we shouldn't need this counter anyways, unless perhaps HPUX uses it. I'm pretty sure glibc won't use it. There are already a number of other linux targets that define this.


Just because _mcount takes a counter address, that doesn't mean that it is actually using the counter. You'd have to check the library sources or docs, or try passing NULL and see if mcount still works.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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