This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: x86-64 profiling fix
- From: Graham Stott <graham dot stott at btinternet dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 17 Oct 2002 18:56:15 +0100
- Subject: Re: x86-64 profiling fix
- References: <20021017172152.GO27492@kam.mff.cuni.cz>
Jan,
Jan Hubicka wrote:
Index: i386.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.472
diff -c -3 -p -r1.472 i386.c
*** i386.c 17 Oct 2002 17:09:16 -0000 1.472
--- i386.c 17 Oct 2002 17:19:41 -0000
*************** x86_field_alignment (field, computed)
*** 13949,13954 ****
--- 13949,13986 ----
return computed;
}
+ /* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. */
+ void
+ x86_function_profiler (file, labelno)
+ FILE *file;
+ int labelno;
+ {
+ if (TARGET_64BIT)
+ if (flag_pic)
+ {
+ fprintf (file, "\tleaq\t%sP%d@(%%rip),%%r11\n",
+ LPREFIX, labelno);
+ fprintf (file, "\tcall\t*_mcount@GOTPCREL(%%rip)\n");
+ }
+ else
+ {
+ fprintf (file, "\tmovq\t$%sP%d,%%r11\n", LPREFIX, labelno);
+ fprintf (file, "\tcall\t_mcount\n");
+ }
The above nested if introduces a new warning.
warning: suggest explicit braces to avoid ambiguous `else'
Graham