OSDN Git Service

Remove assembler dialect dependencies.
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 May 1999 07:46:43 +0000 (07:46 +0000)
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 May 1999 07:46:43 +0000 (07:46 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26776 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/aof.h
gcc/config/arm/arm.h

index c343a1b..fb98a33 100644 (file)
@@ -1,3 +1,13 @@
+Wed May  5 07:40:02 1999  Nick Clifton  <nickc@cygnus.com>
+
+       Patch from: Nick Burrett  <nick.burrett@btinternet.com>
+       * config/arm/arm.h (ARM_MCOUNT_NAME): Define.
+       (FUNCTION_PROFILER): Remove assembler dialect dependency and use
+       ARM_MCOUNT_NAME.
+       (TRAMPOLINE_TEMPLATE): Remove assembler dialect dependency.
+       
+       * config/arm/aof.h (ARM_MCOUNT_NAME): Define.
+
 1999-05-05 09:58 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
 
        * gcc.c (default_compilers): Fix brace nesting bug.
 1999-05-05 09:58 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
 
        * gcc.c (default_compilers): Fix brace nesting bug.
index 6c21850..ce41a70 100644 (file)
@@ -420,6 +420,9 @@ do {                                                \
 #define USER_LABEL_PREFIX ""
 #define LOCAL_LABEL_PREFIX ""
 
 #define USER_LABEL_PREFIX ""
 #define LOCAL_LABEL_PREFIX ""
 
+/* AOF does not prefix user function names with an underscore.  */
+#define ARM_MCOUNT_NAME "_mcount"
+
 /* Output of Dispatch Tables */
 
 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM,BODY,VALUE,REL)                \
 /* Output of Dispatch Tables */
 
 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM,BODY,VALUE,REL)                \
index ef18f49..52b4332 100644 (file)
@@ -1133,15 +1133,42 @@ do {                                                                    \
 #define FUNCTION_PROLOGUE(STREAM, SIZE)  \
   output_func_prologue ((STREAM), (SIZE))
 
 #define FUNCTION_PROLOGUE(STREAM, SIZE)  \
   output_func_prologue ((STREAM), (SIZE))
 
-/* Call the function profiler with a given profile label.  The Acorn compiler
-   puts this BEFORE the prolog but gcc puts it afterwards.  The ``mov ip,lr''
-   seems like a good idea to stick with cc convention.  ``prof'' doesn't seem
-   to mind about this!  */
+/* If your target environment doesn't prefix user functions with an
+   underscore, you may wish to re-define this to prevent any conflicts.
+   e.g. AOF may prefix mcount with an underscore.  */
+#ifndef ARM_MCOUNT_NAME
+#define ARM_MCOUNT_NAME "*mcount"
+#endif
+
+/* Call the function profiler with a given profile label.  The Acorn
+   compiler puts this BEFORE the prolog but gcc puts it afterwards.
+   On the ARM the full profile code will look like:
+       .data
+       LP1
+               .word   0
+       .text
+               mov     ip, lr
+               bl      mcount
+               .word   LP1
+
+   profile_function() in final.c outputs the .data section, FUNCTION_PROFILER
+   will output the .text section.
+
+   The ``mov ip,lr'' seems like a good idea to stick with cc convention.
+   ``prof'' doesn't seem to mind about this!  */
 #define FUNCTION_PROFILER(STREAM,LABELNO)                                  \
 {                                                                          \
 #define FUNCTION_PROFILER(STREAM,LABELNO)                                  \
 {                                                                          \
-    fprintf(STREAM, "\tmov\t%sip, %slr\n", REGISTER_PREFIX, REGISTER_PREFIX); \
-    fprintf(STREAM, "\tbl\tmcount\n");                                     \
-    fprintf(STREAM, "\t.word\tLP%d\n", (LABELNO));                         \
+  char temp[20];                                                           \
+  rtx sym;                                                                 \
+                                                                           \
+  fprintf ((STREAM), "\tmov\t%s%s, %s%s\n\tbl\t",                          \
+          REGISTER_PREFIX, reg_names[12] /* ip */,                         \
+          REGISTER_PREFIX, reg_names[14] /* lr */);                        \
+  assemble_name ((STREAM), ARM_MCOUNT_NAME);                               \
+  fputc ('\n', (STREAM));                                                  \
+  ASM_GENERATE_INTERNAL_LABEL (temp, "LP", (LABELNO));                     \
+  sym = gen_rtx (SYMBOL_REF, Pmode, temp);                                 \
+  ASM_OUTPUT_INT ((STREAM), sym);                                          \
 }
 
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
 }
 
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
@@ -1243,12 +1270,14 @@ do {                                                                    \
    ??? FIXME: When the trampoline returns, r8 will be clobbered.  */
 #define TRAMPOLINE_TEMPLATE(FILE)                              \
 {                                                              \
    ??? FIXME: When the trampoline returns, r8 will be clobbered.  */
 #define TRAMPOLINE_TEMPLATE(FILE)                              \
 {                                                              \
-  fprintf ((FILE), "\tldr\t%sr8, [%spc, #0]\n",                        \
-          REGISTER_PREFIX, REGISTER_PREFIX);                   \
-  fprintf ((FILE), "\tldr\t%spc, [%spc, #0]\n",                        \
-          REGISTER_PREFIX, REGISTER_PREFIX);                   \
-  fprintf ((FILE), "\t.word\t0\n");                            \
-  fprintf ((FILE), "\t.word\t0\n");                            \
+  fprintf ((FILE), "\tldr\t%s%s, [%s%s, #0]\n",                        \
+          REGISTER_PREFIX, reg_names[STATIC_CHAIN_REGNUM],     \
+          REGISTER_PREFIX, reg_names[PC_REGNUM]);              \
+  fprintf ((FILE), "\tldr\t%s%s, [%s%s, #0]\n",                        \
+          REGISTER_PREFIX, reg_names[PC_REGNUM],               \
+          REGISTER_PREFIX, reg_names[PC_REGNUM]);              \
+  ASM_OUTPUT_INT ((FILE), const0_rtx);                         \
+  ASM_OUTPUT_INT ((FILE), const0_rtx);                         \
 }
 
 /* Length in units of the trampoline for entering a nested function.  */
 }
 
 /* Length in units of the trampoline for entering a nested function.  */