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
This commit is contained in:
Carlos O'Donell 2006-07-14 15:54:23 +00:00 committed by Carlos O'Donell
parent 1470f196e4
commit 03471b3fcd
3 changed files with 33 additions and 88 deletions

View File

@ -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> 2006-07-13 Janis Johnson <janis187@us.ibm.com>
* doc/sourcebuild.texi (Test Directives): Document dg-shouldfail. * doc/sourcebuild.texi (Test Directives): Document dg-shouldfail.

View File

@ -486,68 +486,6 @@ extern int dot_symbols;
&& SCALAR_FLOAT_MODE_P (GET_MODE (X)) \ && SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
&& BITS_PER_WORD == HOST_BITS_PER_INT))))) && 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 /* 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 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
true if the symbol may be affected by dynamic relocations. */ true if the symbol may be affected by dynamic relocations. */

View File

@ -905,6 +905,7 @@ static void
dbxout_function_end (tree decl) dbxout_function_end (tree decl)
{ {
char lscope_label_name[100]; char lscope_label_name[100];
int lscope_labelno = scope_labelno++;
/* The Lscope label must be emitted even if we aren't doing anything /* The Lscope label must be emitted even if we aren't doing anything
else; dbxout_block needs it. */ 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 /* Convert Lscope into the appropriate format for local labels in case
the system doesn't insert underscores in front of user generated the system doesn't insert underscores in front of user generated
labels. */ labels. */
ASM_GENERATE_INTERNAL_LABEL (lscope_label_name, "Lscope", scope_labelno); ASM_GENERATE_INTERNAL_LABEL (lscope_label_name, "Lscope", lscope_labelno);
targetm.asm_out.internal_label (asm_out_file, "Lscope", scope_labelno); targetm.asm_out.internal_label (asm_out_file, "Lscope", lscope_labelno);
scope_labelno++;
/* The N_FUN tag at the end of the function is a GNU extension, /* 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 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 /* By convention, GCC will mark the end of a function with an N_FUN
symbol and an empty string. */ 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) if (flag_reorder_blocks_and_partition)
{ {
dbxout_begin_empty_stabs (N_FUN); dbxout_begin_empty_stabs (N_FUN);
@ -942,14 +939,13 @@ dbxout_function_end (tree decl)
} }
else 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_begin_empty_stabs (N_FUN);
dbxout_stab_value_label_diff (lscope_label_name, dbxout_stab_value_label_diff (lscope_label_name, begin_label);
XSTR (XEXP (DECL_RTL (current_function_decl),
0), 0));
} }
#endif
if (!NO_DBX_BNSYM_ENSYM && !flag_debug_only_used_symbols) if (!NO_DBX_BNSYM_ENSYM && !flag_debug_only_used_symbols)
dbxout_stabd (N_ENSYM, 0); 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 static void
dbxout_begin_prologue (unsigned int lineno, const char *filename) 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_stabd (N_BNSYM, 0);
dbxout_source_line (lineno, filename); 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 /* 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 #else
if (DBX_LINES_FUNCTION_RELATIVE) if (DBX_LINES_FUNCTION_RELATIVE)
{ {
rtx begin_label = XEXP (DECL_RTL (current_function_decl), 0); char begin_label[20];
dbxout_begin_stabn_sline (lineno); 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, dbxout_stab_value_internal_label_diff ("LM", &dbxout_source_line_counter,
XSTR (begin_label, 0)); begin_label);
} }
else else
dbxout_stabd (N_SLINE, lineno); dbxout_stabd (N_SLINE, lineno);
@ -3263,15 +3265,11 @@ static void
dbx_output_lbrac (const char *label, dbx_output_lbrac (const char *label,
const char *begin_label ATTRIBUTE_UNUSED) const char *begin_label ATTRIBUTE_UNUSED)
{ {
#ifdef DBX_OUTPUT_LBRAC
DBX_OUTPUT_LBRAC (asm_out_file, label);
#else
dbxout_begin_stabn (N_LBRAC); dbxout_begin_stabn (N_LBRAC);
if (DBX_BLOCKS_FUNCTION_RELATIVE) if (DBX_BLOCKS_FUNCTION_RELATIVE)
dbxout_stab_value_label_diff (label, begin_label); dbxout_stab_value_label_diff (label, begin_label);
else else
dbxout_stab_value_label (label); dbxout_stab_value_label (label);
#endif
} }
/* Subroutine of dbxout_block. Emit an N_RBRAC stab referencing LABEL. /* Subroutine of dbxout_block. Emit an N_RBRAC stab referencing LABEL.
@ -3281,15 +3279,11 @@ static void
dbx_output_rbrac (const char *label, dbx_output_rbrac (const char *label,
const char *begin_label ATTRIBUTE_UNUSED) const char *begin_label ATTRIBUTE_UNUSED)
{ {
#ifdef DBX_OUTPUT_RBRAC
DBX_OUTPUT_RBRAC (asm_out_file, label);
#else
dbxout_begin_stabn (N_RBRAC); dbxout_begin_stabn (N_RBRAC);
if (DBX_BLOCKS_FUNCTION_RELATIVE) if (DBX_BLOCKS_FUNCTION_RELATIVE)
dbxout_stab_value_label_diff (label, begin_label); dbxout_stab_value_label_diff (label, begin_label);
else else
dbxout_stab_value_label (label); dbxout_stab_value_label (label);
#endif
} }
/* Output everything about a symbol block (a BLOCK node /* Output everything about a symbol block (a BLOCK node
@ -3312,8 +3306,9 @@ dbx_output_rbrac (const char *label,
static void static void
dbxout_block (tree block, int depth, tree args) dbxout_block (tree block, int depth, tree args)
{ {
const char *begin_label char begin_label[20];
= XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); /* Reference current function start using LFBB. */
ASM_GENERATE_INTERNAL_LABEL (begin_label, "LFBB", scope_labelno);
while (block) while (block)
{ {
@ -3342,7 +3337,7 @@ dbxout_block (tree block, int depth, tree args)
if (depth == 0) if (depth == 0)
/* The outermost block doesn't get LBB labels; use /* 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; scope_start = begin_label;
else else
{ {