diff options
author | Yiran Wang <yiran@google.com> | 2015-06-23 15:33:17 -0700 |
---|---|---|
committer | Yiran Wang <yiran@google.com> | 2015-06-29 10:56:28 -0700 |
commit | 1d9fec7937f45dde5e04cac966a2d9a12f2fc15a (patch) | |
tree | 3fbcd18a379a05fd6d43491a107e1f36bc61b185 /gcc-4.9/gcc/final.c | |
parent | f378ebf14df0952eae870c9865bab8326aa8f137 (diff) | |
download | toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.zip toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.gz toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.bz2 |
Synchronize with google/gcc-4_9 to r224707 (from r214835)
Change-Id: I3d6f06fc613c8f8b6a82143dc44b7338483aac5d
Diffstat (limited to 'gcc-4.9/gcc/final.c')
-rw-r--r-- | gcc-4.9/gcc/final.c | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/gcc-4.9/gcc/final.c b/gcc-4.9/gcc/final.c index 38c90b2..3bf3fdb 100644 --- a/gcc-4.9/gcc/final.c +++ b/gcc-4.9/gcc/final.c @@ -789,6 +789,15 @@ compute_alignments (void) max_log = log; max_skip = targetm.asm_out.loop_align_max_skip (label); } + /* For small size loop, let them align more strictly. */ + if (targetm.strict_align + && bb->loop_father->num + && (bb->loop_father->ninsns + <= PARAM_VALUE (PARAM_ALIGN_LOOP_SIZE))) + { + max_log = max_log + 1; + max_skip = max_skip * 2; + } } LABEL_TO_ALIGNMENT (label) = max_log; LABEL_TO_MAX_SKIP (label) = max_skip; @@ -1793,18 +1802,6 @@ final_start_function (rtx first, FILE *file, profile_function (file); } - /* If debugging, assign block numbers to all of the blocks in this - function. */ - if (write_symbols) - { - reemit_insn_block_notes (); - number_blocks (current_function_decl); - /* We never actually put out begin/end notes for the top-level - block in the function. But, conceptually, that block is - always needed. */ - TREE_ASM_WRITTEN (DECL_INITIAL (current_function_decl)) = 1; - } - if (warn_frame_larger_than && get_frame_size () > frame_larger_than_size) { @@ -2174,10 +2171,16 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, suffixing "cold" to the original function's name. */ if (in_cold_section_p) { - tree cold_function_name + cold_function_name = clone_function_name (current_function_decl, "cold"); +#ifdef ASM_DECLARE_FUNCTION_NAME + ASM_DECLARE_FUNCTION_NAME (asm_out_file, + IDENTIFIER_POINTER (cold_function_name), + current_function_decl); +#else ASM_OUTPUT_LABEL (asm_out_file, IDENTIFIER_POINTER (cold_function_name)); +#endif } has_cold_section_p = true; break; @@ -4489,6 +4492,18 @@ rest_of_handle_final (void) has_cold_section_p = false; + /* If debugging, assign block numbers to all of the blocks in this + function. */ + if (write_symbols) + { + reemit_insn_block_notes (); + number_blocks (current_function_decl); + /* We never actually put out begin/end notes for the top-level + block in the function. But, conceptually, that block is + always needed. */ + TREE_ASM_WRITTEN (DECL_INITIAL (current_function_decl)) = 1; + } + assemble_start_function (current_function_decl, fnname); final_start_function (get_insns (), asm_out_file, optimize); final (get_insns (), asm_out_file, optimize); @@ -4540,7 +4555,7 @@ rest_of_handle_final (void) /* With -fcallgraph-profiles-sections and -freorder-functions=, add ".gnu.callgraph.text" section for storing profiling information. */ if ((flag_reorder_functions > 1) - && flag_profile_use + && (flag_profile_use || flag_auto_profile) && cgraph_get_node (current_function_decl) != NULL && ((cgraph_get_node (current_function_decl))->callees != NULL || (cgraph_get_node (current_function_decl))->count > 0)) |