(FUNCTION_PROFILER): Complete replacement.
authorRichard Stallman <rms@gnu.org>
Sun, 22 Nov 1992 22:40:53 +0000 (22:40 +0000)
committerRichard Stallman <rms@gnu.org>
Sun, 22 Nov 1992 22:40:53 +0000 (22:40 +0000)
From-SVN: r2776

gcc/config/m68k/hp320.h

index eedf94ec20d0fd74ab3fd5cbcc5f56ba3c9b6369..312c205575b827f704b17bc586672a329775c4f7 100644 (file)
@@ -611,7 +611,12 @@ do{  if (PREFIX[0] == 'L' && PREFIX[1] == 'I')             \
 #else /* not HPUX_ASM */
 
 #undef FUNCTION_PROFILER
-#define FUNCTION_PROFILER(FILE, LABELNO)  \
-   fprintf (FILE, "\tmovl #LP%d,d0\n\tjsr mcount\n", (LABELNO));
+
+/* HP-UX needs the call to mcount before the link instruction.
+   Copy the return address onto the stack before the call to fake it out.  */
+#define FUNCTION_PROFILER(FILE, LABEL_NO) \
+   fprintf (FILE, "\tmovel a6@(4),sp@-\n" \
+                  "\tmovl #LP%d,a0\n\tjsr mcount\n" \
+                  "\taddqw #4,sp\n", (LABEL_NO));
 
 #endif /* not HPUX_ASM */