This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, arm] Thumb profiling is broken
- From: Adam Nemet <anemet at Lnxw dot COM>
- To: gcc-patches at gcc dot gnu dot org
- Cc: nickc at redhat dot com
- Date: 19 Aug 2002 01:56:14 -0700
- Subject: [PATCH, arm] Thumb profiling is broken
Hi,
THUMB_FUNCTION_PROFILER emits the reference to the profiler label
without the leading dot:
.LP3:
.word 0
.text
mov ip, lr
bl mcount
.word LP3
Apparently, THUMB_FUNCTION_PROFILER and ARM_FUNCTION_PROFILER are
supposed to emit the same thing, so I kept the ARM version for both
modes.
Regtested with my previous patch on arm-elf with -mthumb.
Please apply if OK.
Adam
2002-08-18 Adam Nemet <anemet@lnxw.com>
* config/arm/arm.h (ARM_FUNCTION_PROFILER): Remove.
(THUMB_FUNCTION_PROFILER): Likewise.
(FUNCTION_PROFILER): Do what ARM_FUNCTION_PROFILER used to do.
Index: arm.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.155
diff -c -p -r1.155 arm.h
*** arm.h 8 Aug 2002 11:08:34 -0000 1.155
--- arm.h 19 Aug 2002 07:17:01 -0000
*************** typedef struct
*** 1537,1544 ****
The ``mov ip,lr'' seems like a good idea to stick with cc convention.
``prof'' doesn't seem to mind about this! */
! #ifndef ARM_FUNCTION_PROFILER
! #define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
{ \
char temp[20]; \
rtx sym; \
--- 1537,1544 ----
The ``mov ip,lr'' seems like a good idea to stick with cc convention.
``prof'' doesn't seem to mind about this! */
! #ifndef FUNCTION_PROFILER
! #define FUNCTION_PROFILER(STREAM, LABELNO) \
{ \
char temp[20]; \
rtx sym; \
*************** typedef struct
*** 1552,1572 ****
assemble_aligned_integer (UNITS_PER_WORD, sym); \
}
#endif
-
- #ifndef THUMB_FUNCTION_PROFILER
- #define THUMB_FUNCTION_PROFILER(STREAM, LABELNO) \
- { \
- fprintf (STREAM, "\tmov\tip, lr\n"); \
- fprintf (STREAM, "\tbl\tmcount\n"); \
- fprintf (STREAM, "\t.word\tLP%d\n", LABELNO); \
- }
- #endif
-
- #define FUNCTION_PROFILER(STREAM, LABELNO) \
- if (TARGET_ARM) \
- ARM_FUNCTION_PROFILER (STREAM, LABELNO) \
- else \
- THUMB_FUNCTION_PROFILER (STREAM, LABELNO)
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in
--- 1552,1557 ----