]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/final.c
Merge from trunk.
[thirdparty/gcc.git] / gcc / final.c
index 74898a31ade69d8d6309baf5cdc8b393f7b50ccc..e8d14ab3264a73248a3d46a91da6a9b360e3f36d 100644 (file)
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 
 #include "tree.h"
+#include "varasm.h"
 #include "rtl.h"
 #include "tm_p.h"
 #include "regs.h"
@@ -762,7 +763,7 @@ compute_alignments (void)
          && (branch_frequency > freq_threshold
              || (bb->frequency > bb->prev_bb->frequency * 10
                  && (bb->prev_bb->frequency
-                     <= ENTRY_BLOCK_PTR->frequency / 2))))
+                     <= ENTRY_BLOCK_PTR_FOR_FN (cfun)->frequency / 2))))
        {
          log = JUMP_ALIGN (label);
          if (dump_file)
@@ -2168,6 +2169,15 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
          targetm.asm_out.function_switched_text_sections (asm_out_file,
                                                           current_function_decl,
                                                           in_cold_section_p);
+         /* Emit a label for the split cold section.  Form label name by
+            suffixing "cold" to the original function's name.  */
+         if (in_cold_section_p)
+           {
+             tree cold_function_name
+               = clone_function_name (current_function_decl, "cold");
+             ASM_OUTPUT_LABEL (asm_out_file,
+                               IDENTIFIER_POINTER (cold_function_name));
+           }
          break;
 
        case NOTE_INSN_BASIC_BLOCK: