This is the mail archive of the gcc-patches@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]

set no_profile_counters for ia64


I left the code for the profile counter in there Just In Case.  Though
really we should rearrange where the counter gets output if we were to
ever use this code again.

I also swapped it back to right after the alloc insn because of the movl
in the auto-pic case.  FWIW.


r~


        * config/ia64/ia64.h (NO_PROFILE_COUNTERS): New.
        * config/ia64/ia64.c (ia64_output_function_profiler): Honor it.
        Emit out3 load right after alloc.

Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.373
diff -u -p -d -r1.373 ia64.c
--- config/ia64/ia64.c	8 Jun 2005 19:23:04 -0000	1.373
+++ config/ia64/ia64.c	8 Jun 2005 21:22:15 -0000
@@ -8554,26 +8554,33 @@ ia64_vector_mode_supported_p (enum machi
 void
 ia64_output_function_profiler (FILE *file, int labelno)
 {
-  char buf[20];
-  ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
-
   if (TARGET_GNU_AS)
     fputs ("\t.prologue 4, r40\n", file);
   else
     fputs ("\t.prologue\n\t.save ar.pfs, r40\n", file);
   fputs ("\talloc out0 = ar.pfs, 8, 0, 4, 0\n", file);
+
+  if (NO_PROFILE_COUNTERS)
+    fputs ("\tmov out3 = r0\n\t;;\n", file);
+  else
+    {
+      char buf[20];
+      ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
+
+      if (TARGET_AUTO_PIC)
+	fputs ("\tmovl out3 = @gprel(", file);
+      else
+	fputs ("\taddl out3 = @ltoff(", file);
+      assemble_name (file, buf);
+      if (TARGET_AUTO_PIC)
+	fputs (")\n\t;;\n", file);
+      else
+	fputs ("), r1\n\t;;\n", file);
+    }
+
   fputs ("\t.save rp, r42\n", file);
-  fputs ("\tmov out2 = b0\n\t;;\n", file);
+  fputs ("\tmov out2 = b0\n", file);
   fputs ("\t.body\n", file);
-  if (TARGET_AUTO_PIC)
-    fputs ("\tmovl out3 = @gprel(", file);
-  else
-    fputs ("\taddl out3 = @ltoff(", file);
-  assemble_name (file, buf);
-  if (TARGET_AUTO_PIC)
-    fputs (")\n", file);
-  else
-    fputs ("), r1\n", file);
   fputs ("\tmov out1 = r1\n", file);
   fputs ("\tbr.call.sptk.many b0 = _mcount\n\t;;\n", file);
 }
Index: config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.202
diff -u -p -d -r1.202 ia64.h
--- config/ia64/ia64.h	8 Jun 2005 19:23:07 -0000	1.202
+++ config/ia64/ia64.h	8 Jun 2005 21:22:16 -0000
@@ -1267,6 +1267,9 @@ do {									\
 #undef FUNCTION_PROFILER
 #define FUNCTION_PROFILER(FILE, LABELNO) \
   ia64_output_function_profiler(FILE, LABELNO)
+
+/* Neither hpux nor linux use profile counters.  */
+#define NO_PROFILE_COUNTERS 1
 
 /* Trampolines for Nested Functions.  */
 


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