diff options
author | Mark Mitchell <mark@codesourcery.com> | 2001-05-18 07:25:50 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2001-05-18 07:25:50 +0000 |
commit | db3c03158c04178b274114428458ee758284c93c (patch) | |
tree | 42a17eef2f12f7a1de6ec4d4deee148f64370649 /gcc/dwarf2out.c | |
parent | 52a57250621b05048f505946c662675d083d8335 (diff) | |
download | gcc-db3c03158c04178b274114428458ee758284c93c.zip gcc-db3c03158c04178b274114428458ee758284c93c.tar.gz gcc-db3c03158c04178b274114428458ee758284c93c.tar.bz2 |
function.c (expand_function_start): Avoid creating BLKmode pseudos.
* function.c (expand_function_start): Avoid creating BLKmode
pseudos.
* dwarf2out.c (output_comp_unit): Always output a compilation-unit
DIE, even if it has no children.
(dwarf2out_finish): Always output the line-number table, even if
it has no content.
From-SVN: r42254
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 6b825cf..5c05d03 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -5929,10 +5929,13 @@ output_comp_unit (die) { const char *secname; - if (die->die_child == 0) - return; - - /* Mark all the DIEs in this CU so we know which get local refs. */ + /* Even if there are no children of this DIE, we must output the + information about the compilation unit. Otherwise, on an empty + translation unit, we will generate a present, but empty, + .debug_info section. IRIX 6.5 `nm' will then complain when + examining the file. + + Mark all the DIEs in this CU so we know which get local refs. */ mark_dies (die); build_abbrev_table (die); @@ -11250,27 +11253,28 @@ dwarf2out_finish () ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, BSS_END_LABEL, 0); #endif - /* Output the source line correspondence table. */ - if (line_info_table_in_use > 1 || separate_line_info_table_in_use) + /* Output the source line correspondence table. We must do this + even if there is no line information. Otherwise, on an empty + translation unit, we will generate a present, but empty, + .debug_info section. IRIX 6.5 `nm' will then complain when + examining the file. */ + if (! DWARF2_ASM_LINE_DEBUG_INFO) { - if (! DWARF2_ASM_LINE_DEBUG_INFO) - { - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION); - output_line_info (); - } - - /* We can only use the low/high_pc attributes if all of the code - was in .text. */ - if (separate_line_info_table_in_use == 0) - { - add_AT_lbl_id (comp_unit_die, DW_AT_low_pc, text_section_label); - add_AT_lbl_id (comp_unit_die, DW_AT_high_pc, text_end_label); - } + ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION); + output_line_info (); + } - add_AT_lbl_offset (comp_unit_die, DW_AT_stmt_list, - debug_line_section_label); + /* We can only use the low/high_pc attributes if all of the code was + in .text. */ + if (separate_line_info_table_in_use == 0) + { + add_AT_lbl_id (comp_unit_die, DW_AT_low_pc, text_section_label); + add_AT_lbl_id (comp_unit_die, DW_AT_high_pc, text_end_label); } + add_AT_lbl_offset (comp_unit_die, DW_AT_stmt_list, + debug_line_section_label); + #if 0 /* unimplemented */ if (debug_info_level >= DINFO_LEVEL_VERBOSE && primary) add_AT_unsigned (die, DW_AT_macro_info, 0); |