re PR debug/40713 (Overlapping .debug_ranges (C++))

PR debug/40713
	* dwarf2out.c (dw_fde_struct): Add in_std_section and
	cold_in_std_section bits.
	(dwarf2out_begin_prologue): Initialize them.
	(dwarf2out_finish): Don't emit FDE range into .debug_ranges
	if already covered by text_section or cold_text_section range.

From-SVN: r149514
This commit is contained in:
Jakub Jelinek 2009-07-11 19:41:59 +02:00 committed by Jakub Jelinek
parent ae58e54888
commit 3e3a9a6ac1
2 changed files with 43 additions and 6 deletions

View File

@ -1,5 +1,12 @@
2009-07-11 Jakub Jelinek <jakub@redhat.com>
PR debug/40713
* dwarf2out.c (dw_fde_struct): Add in_std_section and
cold_in_std_section bits.
(dwarf2out_begin_prologue): Initialize them.
(dwarf2out_finish): Don't emit FDE range into .debug_ranges
if already covered by text_section or cold_text_section range.
PR rtl-optimization/40667
* defaults.h (MINIMUM_ALIGNMENT): Define if not defined.
* doc/tm.texi (MINIMUM_ALIGNMENT): Document it.

View File

@ -283,6 +283,11 @@ typedef struct GTY(()) dw_fde_struct {
unsigned stack_realign : 1;
/* Whether dynamic realign argument pointer register has been saved. */
unsigned drap_reg_saved: 1;
/* True iff dw_fde_begin label is in text_section or cold_text_section. */
unsigned in_std_section : 1;
/* True iff dw_fde_unlikely_section_label is in text_section or
cold_text_section. */
unsigned cold_in_std_section : 1;
}
dw_fde_node;
@ -3587,6 +3592,7 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
char label[MAX_ARTIFICIAL_LABEL_BYTES];
char * dup_label;
dw_fde_ref fde;
section *fnsec;
current_function_func_begin_label = NULL;
@ -3602,7 +3608,8 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
return;
#endif
switch_to_section (function_section (current_function_decl));
fnsec = function_section (current_function_decl);
switch_to_section (fnsec);
ASM_GENERATE_INTERNAL_LABEL (label, FUNC_BEGIN_LABEL,
current_function_funcdef_no);
ASM_OUTPUT_DEBUG_LABEL (asm_out_file, FUNC_BEGIN_LABEL,
@ -3646,6 +3653,27 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
fde->all_throwers_are_sibcalls = crtl->all_throwers_are_sibcalls;
fde->drap_reg = INVALID_REGNUM;
fde->vdrap_reg = INVALID_REGNUM;
if (flag_reorder_blocks_and_partition)
{
section *unlikelysec;
if (first_function_block_is_cold)
fde->in_std_section = 1;
else
fde->in_std_section
= (fnsec == text_section
|| (cold_text_section && fnsec == cold_text_section));
unlikelysec = unlikely_text_section ();
fde->cold_in_std_section
= (unlikelysec == text_section
|| (cold_text_section && unlikelysec == cold_text_section));
}
else
{
fde->in_std_section
= (fnsec == text_section
|| (cold_text_section && fnsec == cold_text_section));
fde->cold_in_std_section = 0;
}
args_size = old_args_size = 0;
@ -17128,12 +17156,14 @@ dwarf2out_finish (const char *filename)
if (fde->dw_fde_switched_sections)
{
add_ranges_by_labels (fde->dw_fde_hot_section_label,
fde->dw_fde_hot_section_end_label);
add_ranges_by_labels (fde->dw_fde_unlikely_section_label,
fde->dw_fde_unlikely_section_end_label);
if (!fde->in_std_section)
add_ranges_by_labels (fde->dw_fde_hot_section_label,
fde->dw_fde_hot_section_end_label);
if (!fde->cold_in_std_section)
add_ranges_by_labels (fde->dw_fde_unlikely_section_label,
fde->dw_fde_unlikely_section_end_label);
}
else
else if (!fde->in_std_section)
add_ranges_by_labels (fde->dw_fde_begin,
fde->dw_fde_end);
}