aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos O'Donell <carlos@codesourcery.com>2006-07-14 15:54:23 +0000
committerCarlos O'Donell <carlos@gcc.gnu.org>2006-07-14 15:54:23 +0000
commit03471b3fcd6dd21855ba0ed90b7963d90904b08b (patch)
tree7371a8b2fee00fa92e9edb125a2420b945596e6d
parent1470f196e47e33334ca4ff0cd71ebd3a1bad30de (diff)
downloadgcc-03471b3fcd6dd21855ba0ed90b7963d90904b08b.zip
gcc-03471b3fcd6dd21855ba0ed90b7963d90904b08b.tar.gz
gcc-03471b3fcd6dd21855ba0ed90b7963d90904b08b.tar.bz2
dbxout.c (dbxout_begin_prologue): Emit LFBB label at function start.
gcc/ 2006-07-14 Carlos O'Donell <carlos@codesoucery.com> * dbxout.c (dbxout_begin_prologue): Emit LFBB label at function start. (dbxout_function_end): Use local label LFBB. Remove hook DBX_OUTPUT_NFUN. (dbxout_source_line): Use local label LFBB. (dbxout_block): Likewise. (dbx_output_lbrac): Remove hook DBX_OUTPUT_LBRAC. (dbx_output_rbrac): Remove hook DBX_OUTPUT_RBRAC. * config/rs6000/linux64.h: Remove DBX_OUTPUT_LBRAC, DBX_OUTPUT_RBRAC, and DBX_OUTPUT_NFUN. From-SVN: r115444
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config/rs6000/linux64.h62
-rw-r--r--gcc/dbxout.c47
3 files changed, 33 insertions, 88 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6dca0bf..5a604c0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2006-07-14 Carlos O'Donell <carlos@codesoucery.com>
+
+
+ * dbxout.c (dbxout_begin_prologue): Emit LFBB label at function start.
+ (dbxout_function_end): Use local label LFBB. Remove hook DBX_OUTPUT_NFUN.
+ (dbxout_source_line): Use local label LFBB.
+ (dbxout_block): Likewise.
+ (dbx_output_lbrac): Remove hook DBX_OUTPUT_LBRAC.
+ (dbx_output_rbrac): Remove hook DBX_OUTPUT_RBRAC.
+ * config/rs6000/linux64.h: Remove DBX_OUTPUT_LBRAC, DBX_OUTPUT_RBRAC,
+ and DBX_OUTPUT_NFUN.
+
2006-07-13 Janis Johnson <janis187@us.ibm.com>
* doc/sourcebuild.texi (Test Directives): Document dg-shouldfail.
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 26f7496..f52b245 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -486,68 +486,6 @@ extern int dot_symbols;
&& SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
&& BITS_PER_WORD == HOST_BITS_PER_INT)))))
-/* This ABI cannot use DBX_LINES_FUNCTION_RELATIVE, nor can it use
- dbxout_stab_value_internal_label_diff, because we must
- use the function code label, not the function descriptor label. */
-#define DBX_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
-do \
- { \
- char temp[256]; \
- const char *s; \
- ASM_GENERATE_INTERNAL_LABEL (temp, "LM", COUNTER); \
- dbxout_begin_stabn_sline (LINE); \
- assemble_name (FILE, temp); \
- putc ('-', FILE); \
- s = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); \
- rs6000_output_function_entry (FILE, s); \
- putc ('\n', FILE); \
- targetm.asm_out.internal_label (FILE, "LM", COUNTER); \
- COUNTER += 1; \
- } \
-while (0)
-
-/* Similarly, we want the function code label here. Cannot use
- dbxout_stab_value_label_diff, as we have to use
- rs6000_output_function_entry. FIXME. */
-#define DBX_OUTPUT_BRAC(FILE, NAME, BRAC) \
- do \
- { \
- const char *s; \
- dbxout_begin_stabn (BRAC); \
- s = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); \
- /* dbxout_block passes this macro the function name as NAME, \
- assuming that it is the function code start label. In our \
- case, the function name is the OPD entry. dbxout_block is \
- broken, hack around it here. */ \
- if (NAME == s) \
- putc ('0', FILE); \
- else \
- { \
- assemble_name (FILE, NAME); \
- putc ('-', FILE); \
- rs6000_output_function_entry (FILE, s); \
- } \
- putc ('\n', FILE); \
- } \
- while (0)
-
-#define DBX_OUTPUT_LBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_LBRAC)
-#define DBX_OUTPUT_RBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_RBRAC)
-
-/* Another case where we want the dot name. */
-#define DBX_OUTPUT_NFUN(FILE, LSCOPE, DECL) \
- do \
- { \
- const char *s; \
- dbxout_begin_empty_stabs (N_FUN); \
- assemble_name (FILE, LSCOPE); \
- putc ('-', FILE); \
- s = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); \
- rs6000_output_function_entry (FILE, s); \
- putc ('\n', FILE); \
- } \
- while (0)
-
/* Select a format to encode pointers in exception handling data. CODE
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
true if the symbol may be affected by dynamic relocations. */
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index f936ac6..07d0bcc 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -905,6 +905,7 @@ static void
dbxout_function_end (tree decl)
{
char lscope_label_name[100];
+ int lscope_labelno = scope_labelno++;
/* The Lscope label must be emitted even if we aren't doing anything
else; dbxout_block needs it. */
@@ -913,9 +914,8 @@ dbxout_function_end (tree decl)
/* Convert Lscope into the appropriate format for local labels in case
the system doesn't insert underscores in front of user generated
labels. */
- ASM_GENERATE_INTERNAL_LABEL (lscope_label_name, "Lscope", scope_labelno);
- targetm.asm_out.internal_label (asm_out_file, "Lscope", scope_labelno);
- scope_labelno++;
+ ASM_GENERATE_INTERNAL_LABEL (lscope_label_name, "Lscope", lscope_labelno);
+ targetm.asm_out.internal_label (asm_out_file, "Lscope", lscope_labelno);
/* The N_FUN tag at the end of the function is a GNU extension,
which may be undesirable, and is unnecessary if we do not have
@@ -928,9 +928,6 @@ dbxout_function_end (tree decl)
/* By convention, GCC will mark the end of a function with an N_FUN
symbol and an empty string. */
-#ifdef DBX_OUTPUT_NFUN
- DBX_OUTPUT_NFUN (asm_out_file, lscope_label_name, current_function_decl);
-#else
if (flag_reorder_blocks_and_partition)
{
dbxout_begin_empty_stabs (N_FUN);
@@ -942,13 +939,12 @@ dbxout_function_end (tree decl)
}
else
{
+ char begin_label[20];
+ /* Reference current function start using LFBB. */
+ ASM_GENERATE_INTERNAL_LABEL (begin_label, "LFBB", lscope_labelno);
dbxout_begin_empty_stabs (N_FUN);
- dbxout_stab_value_label_diff (lscope_label_name,
- XSTR (XEXP (DECL_RTL (current_function_decl),
- 0), 0));
+ dbxout_stab_value_label_diff (lscope_label_name, begin_label);
}
-
-#endif
if (!NO_DBX_BNSYM_ENSYM && !flag_debug_only_used_symbols)
dbxout_stabd (N_ENSYM, 0);
@@ -1241,7 +1237,8 @@ dbxout_source_file (const char *filename)
}
}
-/* Output N_BNSYM and line number symbol entry. */
+/* Output N_BNSYM, line number symbol entry, and local symbol at
+ function scope */
static void
dbxout_begin_prologue (unsigned int lineno, const char *filename)
@@ -1253,6 +1250,10 @@ dbxout_begin_prologue (unsigned int lineno, const char *filename)
dbxout_stabd (N_BNSYM, 0);
dbxout_source_line (lineno, filename);
+ /* Output function begin block at function scope, referenced
+ by dbxout_block, dbxout_source_line and dbxout_function_end. */
+ emit_pending_bincls_if_required ();
+ targetm.asm_out.internal_label (asm_out_file, "LFBB", scope_labelno);
}
/* Output a line number symbol entry for source file FILENAME and line
@@ -1268,11 +1269,12 @@ dbxout_source_line (unsigned int lineno, const char *filename)
#else
if (DBX_LINES_FUNCTION_RELATIVE)
{
- rtx begin_label = XEXP (DECL_RTL (current_function_decl), 0);
+ char begin_label[20];
dbxout_begin_stabn_sline (lineno);
+ /* Reference current function start using LFBB. */
+ ASM_GENERATE_INTERNAL_LABEL (begin_label, "LFBB", scope_labelno);
dbxout_stab_value_internal_label_diff ("LM", &dbxout_source_line_counter,
- XSTR (begin_label, 0));
-
+ begin_label);
}
else
dbxout_stabd (N_SLINE, lineno);
@@ -3263,15 +3265,11 @@ static void
dbx_output_lbrac (const char *label,
const char *begin_label ATTRIBUTE_UNUSED)
{
-#ifdef DBX_OUTPUT_LBRAC
- DBX_OUTPUT_LBRAC (asm_out_file, label);
-#else
dbxout_begin_stabn (N_LBRAC);
if (DBX_BLOCKS_FUNCTION_RELATIVE)
dbxout_stab_value_label_diff (label, begin_label);
else
dbxout_stab_value_label (label);
-#endif
}
/* Subroutine of dbxout_block. Emit an N_RBRAC stab referencing LABEL.
@@ -3281,15 +3279,11 @@ static void
dbx_output_rbrac (const char *label,
const char *begin_label ATTRIBUTE_UNUSED)
{
-#ifdef DBX_OUTPUT_RBRAC
- DBX_OUTPUT_RBRAC (asm_out_file, label);
-#else
dbxout_begin_stabn (N_RBRAC);
if (DBX_BLOCKS_FUNCTION_RELATIVE)
dbxout_stab_value_label_diff (label, begin_label);
else
dbxout_stab_value_label (label);
-#endif
}
/* Output everything about a symbol block (a BLOCK node
@@ -3312,8 +3306,9 @@ dbx_output_rbrac (const char *label,
static void
dbxout_block (tree block, int depth, tree args)
{
- const char *begin_label
- = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
+ char begin_label[20];
+ /* Reference current function start using LFBB. */
+ ASM_GENERATE_INTERNAL_LABEL (begin_label, "LFBB", scope_labelno);
while (block)
{
@@ -3342,7 +3337,7 @@ dbxout_block (tree block, int depth, tree args)
if (depth == 0)
/* The outermost block doesn't get LBB labels; use
- the function symbol. */
+ the LFBB local symbol emitted by dbxout_begin_prologue. */
scope_start = begin_label;
else
{