2011-05-04 Stuart Henderson <shenders@gcc.gnu.org>
authorStuart Henderson <shenders@gcc.gnu.org>
Wed, 4 May 2011 10:48:55 +0000 (10:48 +0000)
committerStuart Henderson <shenders@gcc.gnu.org>
Wed, 4 May 2011 10:48:55 +0000 (10:48 +0000)
        From Bernd Schmidt
        * config/bfin/bfin.h (FUNCTION_PROFILER): Take TARGET_LONG_CALLS into
        account and save/restore RETS.
        (PROFILE_BEFORE_PROLOGUE): Define.
        (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Add tab character.  Correct
        the push insn to use predecrement.

From-SVN: r173365

gcc/ChangeLog
gcc/config/bfin/bfin.h

index 3722fe5e6f8d5581f8a54fc287f3a830ecf1de86..6f509040f39ac0df4fccd9236c4d8b5c49e8c6b5 100644 (file)
@@ -1,3 +1,12 @@
+2011-05-04  Stuart Henderson  <shenders@gcc.gnu.org>
+
+       From Bernd Schmidt
+       * config/bfin/bfin.h (FUNCTION_PROFILER): Take TARGET_LONG_CALLS into
+       account and save/restore RETS.
+       (PROFILE_BEFORE_PROLOGUE): Define.
+       (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Add tab character.  Correct
+       the push insn to use predecrement.
+
 2011-05-04  Stuart Henderson  <shenders@gcc.gnu.org>
 
        From Jie Zhang
index d3bdd5606b43fd9ee3f26ebed098ee428e4c1a89..0d83ad8212666581d7511734d740923168857629 100644 (file)
@@ -1126,16 +1126,26 @@ do {                                            \
 
 #define ASM_COMMENT_START "//"
 
+#define PROFILE_BEFORE_PROLOGUE
 #define FUNCTION_PROFILER(FILE, LABELNO)       \
   do {                                         \
-    fprintf (FILE, "\tCALL __mcount;\n");      \
+    fprintf (FILE, "\t[--SP] = RETS;\n");      \
+    if (TARGET_LONG_CALLS)                     \
+      {                                                \
+       fprintf (FILE, "\tP2.h = __mcount;\n"); \
+       fprintf (FILE, "\tP2.l = __mcount;\n"); \
+       fprintf (FILE, "\tCALL (P2);\n");       \
+      }                                                \
+    else                                       \
+      fprintf (FILE, "\tCALL __mcount;\n");    \
+    fprintf (FILE, "\tRETS = [SP++];\n");      \
   } while(0)
 
 #undef NO_PROFILE_COUNTERS
 #define NO_PROFILE_COUNTERS 1
 
-#define ASM_OUTPUT_REG_PUSH(FILE, REGNO) fprintf (FILE, "[SP--] = %s;\n", reg_names[REGNO])
-#define ASM_OUTPUT_REG_POP(FILE, REGNO)  fprintf (FILE, "%s = [SP++];\n", reg_names[REGNO])
+#define ASM_OUTPUT_REG_PUSH(FILE, REGNO) fprintf (FILE, "\t[--SP] = %s;\n", reg_names[REGNO])
+#define ASM_OUTPUT_REG_POP(FILE, REGNO)  fprintf (FILE, "\t%s = [SP++];\n", reg_names[REGNO])
 
 extern rtx bfin_cc_rtx, bfin_rets_rtx;