This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dbxout.c overhaul, finally done


Hi,

We got a new failure when I build m32r-elf-gcc with the following patch.
Would you give me advice?

ng.log is a failure log.

m32r-elf-gcc uses a 'begin_label' in DBX_OUTPUT_SOURCE_LINE macro
 (m32r.h).
Is it a reasonable?

Regards,

Kazuhiro inaoka

Richard Sandiford wrote:

This bit...

Zack Weinberg <zack@codesourcery.com> writes:

@@ -789,29 +1233,22 @@ dbxout_begin_prologue (unsigned int line
static void
dbxout_source_line (unsigned int lineno, const char *filename)
{
-  dbxout_source_file (asm_out_file, filename);
+  const char *begin_label = XSTR(XEXP(DECL_RTL(current_function_decl), 0), 0);
+
+  dbxout_source_file (filename);

#ifdef DBX_OUTPUT_SOURCE_LINE
-  dbxout_source_line_counter += 1;
  DBX_OUTPUT_SOURCE_LINE (asm_out_file, lineno, dbxout_source_line_counter);
#else
  if (DBX_LINES_FUNCTION_RELATIVE)
    {
-      char label[100];
-      dbxout_source_line_counter += 1;
+      dbxout_begin_stabn_sline (lineno);
+      dbxout_stab_value_internal_label_diff ("LM", &dbxout_source_line_counter,
+					     begin_label);

-      ASM_GENERATE_INTERNAL_LABEL (label, "LM", dbxout_source_line_counter);
-      fprintf (asm_out_file, "%s%d,0,%d,", ASM_STABN_OP, N_SLINE, lineno);
-      assemble_name (asm_out_file, label);
-      putc ('-', asm_out_file);
-      assemble_name (asm_out_file,
-		     XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));
-      putc ('\n', asm_out_file);
-      targetm.asm_out.internal_label (asm_out_file, "LM",
-				      dbxout_source_line_counter);
    }
  else
-    fprintf (asm_out_file, "%s%d,0,%d\n", ASM_STABD_OP, N_SLINE, lineno);
+    dbxout_stabd (N_SLINE, lineno);
#endif
}


...broke bootstrap on targets that define DBX_OUTPUT_SOURCE_LINE,
because begin_label is only used in the #else block.  Fixed with the
patch below.  Bootstrapped on mips64-linux-gnu to make sure that it got
past the source of the failure.  Also bootstrapped on i686-pc-linux-gnu
(for which DBX_LINES_FUNCTION_RELATIVE is true) and tested with -gstabs+.
Committed as obvious.

Richard


* dbxout.c (dbxout_source_line): Move declaration of begin_label to the block that needs it.

Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.211
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.211 dbxout.c
--- dbxout.c 27 Oct 2004 01:29:39 -0000 1.211
+++ dbxout.c 27 Oct 2004 17:17:11 -0000
@@ -1233,8 +1233,6 @@ dbxout_begin_prologue (unsigned int line
static void
dbxout_source_line (unsigned int lineno, const char *filename)
{
- const char *begin_label = XSTR(XEXP(DECL_RTL(current_function_decl), 0), 0);
-
dbxout_source_file (filename);
#ifdef DBX_OUTPUT_SOURCE_LINE
@@ -1242,9 +1240,10 @@ dbxout_source_line (unsigned int lineno,
#else
if (DBX_LINES_FUNCTION_RELATIVE)
{
+ rtx begin_label = XEXP (DECL_RTL (current_function_decl), 0);
dbxout_begin_stabn_sline (lineno);
dbxout_stab_value_internal_label_diff ("LM", &dbxout_source_line_counter,
- begin_label);
+ XSTR (begin_label, 0));
}
else


gcc -c   -g -O2 -DIN_GCC -DCROSS_COMPILE  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes  -fno-common   -DHAVE_CONFIG_H    -I. -I. -I/home3/FSF/org_src/gcc/gcc/gcc -I/home3/FSF/org_src/gcc/gcc/gcc/. -I/home3/FSF/org_src/gcc/gcc/gcc/../include -I/home3/FSF/org_src/gcc/gcc/gcc/../libcpp/include  /home3/FSF/org_src/gcc/gcc/gcc/dbxout.c -o dbxout.o
/home3/FSF/org_src/gcc/gcc/gcc/dbxout.c: In function `dbxout_source_line':
/home3/FSF/org_src/gcc/gcc/gcc/dbxout.c:1240: error: `begin_label' undeclared (first use in this function)
/home3/FSF/org_src/gcc/gcc/gcc/dbxout.c:1240: error: (Each undeclared identifier is reported only once
/home3/FSF/org_src/gcc/gcc/gcc/dbxout.c:1240: error: for each function it appears in.)
make[1]: *** [dbxout.o] Error 1
make[1]: Leaving directory `/home3/FSF/org_src/gcc/build/gcc'
make: *** [all-gcc] Error 2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]