aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-11-27 20:37:00 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2010-11-27 19:37:00 +0000
commit267eb218c34a2b8d9e0d27f018547b69cf67a56c (patch)
treed03cba386eca02a89541251b48a7c88e2be131ba /gcc/dwarf2out.c
parent17a3480b6a53b15c54f6f60aaf467232ac54d83d (diff)
downloadgcc-267eb218c34a2b8d9e0d27f018547b69cf67a56c.zip
gcc-267eb218c34a2b8d9e0d27f018547b69cf67a56c.tar.gz
gcc-267eb218c34a2b8d9e0d27f018547b69cf67a56c.tar.bz2
dwarf2out.c (dwarf2out_begin_function): Set cold_text_section and output cold_text_section_label.
* dwarf2out.c (dwarf2out_begin_function): Set cold_text_section and output cold_text_section_label. (dwarf2out_init): Don't do that there. (dwarf2out_finish): Handle cold section end label only if cold section was used. From-SVN: r167208
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index e230861..dfb5720 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -21676,6 +21676,14 @@ dwarf2out_begin_function (tree fun)
{
if (function_section (fun) != text_section)
have_multiple_function_sections = true;
+ else if (flag_reorder_blocks_and_partition && !cold_text_section)
+ {
+ gcc_assert (current_function_decl == fun);
+ cold_text_section = unlikely_text_section ();
+ switch_to_section (cold_text_section);
+ ASM_OUTPUT_LABEL (asm_out_file, cold_text_section_label);
+ switch_to_section (current_function_section ());
+ }
dwarf2out_note_section_used ();
}
@@ -21996,13 +22004,6 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
switch_to_section (text_section);
ASM_OUTPUT_LABEL (asm_out_file, text_section_label);
- if (flag_reorder_blocks_and_partition)
- {
- cold_text_section = unlikely_text_section ();
- switch_to_section (cold_text_section);
- ASM_OUTPUT_LABEL (asm_out_file, cold_text_section_label);
- }
-
}
/* Called before cgraph_optimize starts outputtting functions, variables
@@ -23107,9 +23108,9 @@ dwarf2out_finish (const char *filename)
/* Output a terminator label for the .text section. */
switch_to_section (text_section);
targetm.asm_out.internal_label (asm_out_file, TEXT_END_LABEL, 0);
- if (flag_reorder_blocks_and_partition)
+ if (cold_text_section)
{
- switch_to_section (unlikely_text_section ());
+ switch_to_section (cold_text_section);
targetm.asm_out.internal_label (asm_out_file, COLD_END_LABEL, 0);
}