aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-07-11 19:41:59 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2009-07-11 19:41:59 +0200
commit3e3a9a6ac1608dcafc4ef5c96a8f30c1d5243dc5 (patch)
treed3578728092d1e9b6834ded4b1a00c0768535609 /gcc
parentae58e548884f696e600966549867df23de3ff2d3 (diff)
downloadgcc-3e3a9a6ac1608dcafc4ef5c96a8f30c1d5243dc5.zip
gcc-3e3a9a6ac1608dcafc4ef5c96a8f30c1d5243dc5.tar.gz
gcc-3e3a9a6ac1608dcafc4ef5c96a8f30c1d5243dc5.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/dwarf2out.c42
2 files changed, 43 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f3d298e..e84fabc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index fce8b92..f7afc17 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -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);
}