]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* dwarf2out.c (dwarf2out_begin_function): Set cold_text_section
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 27 Nov 2010 19:37:00 +0000 (19:37 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 27 Nov 2010 19:37:00 +0000 (19:37 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167208 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dwarf2out.c

index faf40b1b48340d846ff4808336040a611620c7ac..ac73a66673a5b22967a63283e4482b0878a85253 100644 (file)
@@ -1,3 +1,11 @@
+2010-11-27  Jan Hubicka  <jh@suse.cz>
+
+       * 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.
+
 2010-11-27  Eric Botcazou  <ebotcazou@adacore.com>
 
        * tree-nested.c (remap_vla_decls): Fully expand value expressions of
index e230861158ed3f293a39b396b090255dfc6ef27c..dfb57209b3e7cf5d3fa598d3dbc185312dc8b9dc 100644 (file)
@@ -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);
     }