Commit d2a8e680 by Richard Stallman

(FUNCTION_PROFILER): Use ASM_OUTPUT_INTERNAL_LABELREF.

(FUNCTION_BLOCK_PROFILER):  Mark with FIXME that it needs work.
(ASM_OUTPUT_INTERNAL_LABELREF):  Define.

(CONSTANT_ALIGNMENT): Add parens for Sun compiler.

From-SVN: r1641
parent a124fd5e
...@@ -194,8 +194,9 @@ extern int target_flags; ...@@ -194,8 +194,9 @@ extern int target_flags;
/* Make strings word-aligned so strcpy from constants will be faster. */ /* Make strings word-aligned so strcpy from constants will be faster. */
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \ #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
(TREE_CODE (EXP) == STRING_CST \ ((TREE_CODE (EXP) == STRING_CST \
&& (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN)) && (ALIGN) < FASTEST_ALIGNMENT) \
? FASTEST_ALIGNMENT : (ALIGN))
/* Make arrays of chars word-aligned for the same reasons. */ /* Make arrays of chars word-aligned for the same reasons. */
#define DATA_ALIGNMENT(TYPE, ALIGN) \ #define DATA_ALIGNMENT(TYPE, ALIGN) \
...@@ -845,12 +846,19 @@ extern int apparent_fsize; ...@@ -845,12 +846,19 @@ extern int apparent_fsize;
/* Output assembler code to FILE to increment profiler label # LABELNO /* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */ for profiling a function entry. */
#define FUNCTION_PROFILER(FILE, LABELNO) \ #define FUNCTION_PROFILER(FILE, LABELNO) \
fprintf (FILE, "\tsethi %%hi(LP%d),%%o0\n\tcall mcount\n\tor %%lo(LP%d),%%o0,%%o0\n", \ do { \
(LABELNO), (LABELNO)) fputs ("\tsethi %hi(", (FILE)); \
ASM_OUTPUT_INTERNAL_LABELREF (FILE, "LP", LABELNO); \
fputs ("),%o0\n\tcall mcount\n\tor %lo(", (FILE)); \
ASM_OUTPUT_INTERNAL_LABELREF (FILE, "LP", LABELNO); \
fputs ("),%o0,%o0\n", (FILE)); \
} while (0)
/* Output assembler code to FILE to initialize this source file's /* Output assembler code to FILE to initialize this source file's
basic block profiling info, if that has not already been done. */ basic block profiling info, if that has not already been done. */
/* FIXME -- this does not parameterize how it generates labels (like the
above FUNCTION_PROFILER). Broken on Solaris-2. --gnu@cygnus.com */
#define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \ #define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \
fprintf (FILE, "\tsethi %%hi(LPBX0),%%o0\n\tld [%%lo(LPBX0)+%%o0],%%o1\n\ttst %%o1\n\tbne LPY%d\n\tadd %%o0,%%lo(LPBX0),%%o0\n\tcall ___bb_init_func\n\tnop\nLPY%d:\n", \ fprintf (FILE, "\tsethi %%hi(LPBX0),%%o0\n\tld [%%lo(LPBX0)+%%o0],%%o1\n\ttst %%o1\n\tbne LPY%d\n\tadd %%o0,%%lo(LPBX0),%%o0\n\tcall ___bb_init_func\n\tnop\nLPY%d:\n", \
...@@ -1483,12 +1491,21 @@ extern struct rtx_def *legitimize_pic_address (); ...@@ -1483,12 +1491,21 @@ extern struct rtx_def *legitimize_pic_address ();
#define ASM_OUTPUT_LABELREF(FILE,NAME) \ #define ASM_OUTPUT_LABELREF(FILE,NAME) \
fprintf (FILE, "_%s", NAME) fprintf (FILE, "_%s", NAME)
/* This is how to output an internal numbered label where /* This is how to output a definition of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. */ PREFIX is the class of label and NUM is the number within the class. */
#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
fprintf (FILE, "%s%d:\n", PREFIX, NUM) fprintf (FILE, "%s%d:\n", PREFIX, NUM)
/* This is how to output a reference to an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. */
/* FIXME: This should be used throughout gcc, and documented in the texinfo
files. There is no reason you should have to allocate a buffer and
`sprintf' to reference an internal label (as opposed to defining it). */
#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \
fprintf (FILE, "%s%d", PREFIX, NUM)
/* This is how to store into the string LABEL /* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. PREFIX is the class of label and NUM is the number within the class.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment