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]

[PATCH] Fix PR46559, link fails with libstdc++ testsuite and lto


LTO fails foul of us using a local variable 'die' for location list
processing in dwarf2out_finish which is only initialized to the
last member of the limbo die list.  By chance this is probably
always the comp-unit die for non-LTO invocation.  Still this doesn't
look like good programming style, so the following fixes that,
making the reference to comp_unit_die explicit and by that also
fixes the LTO link fails (which were due to no location lists
being present).

Bootstrap and regtest running on x86_64-unknown-linux-gnu, ok if
that succeeds?

Thanks,
Richard.

2010-11-26  Richard Guenther  <rguenther@suse.de>

	PR middle-end/46559
	* dwarf2out.c (dwarf2out_finish): Use comp_unit_die as root
	for location list processing.

Index: gcc/dwarf2out.c
===================================================================
*** gcc/dwarf2out.c	(revision 167177)
--- gcc/dwarf2out.c	(working copy)
*************** dwarf2out_finish (const char *filename)
*** 22965,22971 ****
    limbo_die_node *node, *next_node;
    comdat_type_node *ctnode;
    htab_t comdat_type_table;
-   dw_die_ref die = 0;
    unsigned int i;
  
    gen_remaining_tmpl_value_param_die_attribute ();
--- 22965,22970 ----
*************** dwarf2out_finish (const char *filename)
*** 22998,23005 ****
       instance.  */
    for (node = limbo_die_list; node; node = next_node)
      {
        next_node = node->next;
-       die = node->die;
  
        if (die->die_parent == NULL)
  	{
--- 22997,23004 ----
       instance.  */
    for (node = limbo_die_list; node; node = next_node)
      {
+       dw_die_ref die = node->die;
        next_node = node->next;
  
        if (die->die_parent == NULL)
  	{
*************** dwarf2out_finish (const char *filename)
*** 23177,23183 ****
      add_AT_macptr (comp_unit_die (), DW_AT_macro_info, macinfo_section_label);
  
    if (have_location_lists)
!     optimize_location_lists (die);
  
    /* Output all of the compilation units.  We put the main one last so that
       the offsets are available to output_pubnames.  */
--- 23176,23182 ----
      add_AT_macptr (comp_unit_die (), DW_AT_macro_info, macinfo_section_label);
  
    if (have_location_lists)
!     optimize_location_lists (comp_unit_die ());
  
    /* Output all of the compilation units.  We put the main one last so that
       the offsets are available to output_pubnames.  */
*************** dwarf2out_finish (const char *filename)
*** 23222,23228 ****
        ASM_GENERATE_INTERNAL_LABEL (loc_section_label,
  				   DEBUG_LOC_SECTION_LABEL, 0);
        ASM_OUTPUT_LABEL (asm_out_file, loc_section_label);
!       output_location_lists (die);
      }
  
    /* Output public names table if necessary.  */
--- 23221,23227 ----
        ASM_GENERATE_INTERNAL_LABEL (loc_section_label,
  				   DEBUG_LOC_SECTION_LABEL, 0);
        ASM_OUTPUT_LABEL (asm_out_file, loc_section_label);
!       output_location_lists (comp_unit_die ());
      }
  
    /* Output public names table if necessary.  */


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