This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Accessing IP on IA-64 with RTL
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: rth at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 28 Jan 2005 08:59:58 -0800 (PST)
- Subject: Re: Accessing IP on IA-64 with RTL
> On Thu, Jan 27, 2005 at 03:24:23PM -0800, Steve Ellcey wrote:
> > ... but I also see a comment that this is
> > intended to be called before the function prologue and it is not clear
> > to me that there is any sensible way to call this routine after the
> > function prologue.
>
> I think that comment is in error. We currently call it after the
> prologue, and it works.
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
Looking at the attached assembly language output for "foo () { bar (); }",
I see the profile code for foo at lines 13-17 and the prologue at lines 18-25.
Steve Ellcey
sje@cup.hp.com
1 .file "x.c"
2 .pred.safe_across_calls p1-p5,p16-p63
3 .text
4 .align 16
5 .global foo#
6 .proc foo#
7 foo:
8 .data
9 .align 8
10 .LP2:
11 data8 0
12 .text
13 alloc out0 = ar.pfs, 8, 0, 4, 0
14 addl out3 = @ltoff(.LP2), r1;;
15 mov out1 = r1
16 mov out2 = b0
17 br.call.sptk.many b0 = _mcount;;
18 .prologue 14, 32
19 .save ar.pfs, r33
20 alloc r33 = ar.pfs, 0, 4, 1, 0
21 .vframe r34
22 mov r34 = r12
23 mov r35 = r1
24 .save rp, r32
25 mov r32 = b0
26 .body
27 ;;
28 br.call.sptk.many b0 = bar#
29 mov r1 = r35
30 ;;
31 mov ar.pfs = r33
32 mov b0 = r32
33 .restore sp
34 mov r12 = r34
35 br.ret.sptk.many b0
36 ;;
37 .endp foo#
38 .ident "GCC: (GNU) 4.0.0 20050124 (experimental)"