From e4598783b440d7623b27dd05994ec131d697ced0 Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Wed, 27 Jul 2005 21:02:55 +0000 Subject: [PATCH] re PR c++/22003 (-freorder-blocks-and-partition and thunks) PR c++/22003 * varasm.c (assemble_start_function): Don't do anything that may require a CFG if the current function is a thunk. From-SVN: r102444 --- gcc/ChangeLog | 6 ++++++ gcc/varasm.c | 15 ++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index baca021515f..a7ac9a46295 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-07-27 Steven Bosscher + + PR c++/22003 + * varasm.c (assemble_start_function): Don't do anything that may + require a CFG if the current function is a thunk. + 2005-07-25 Geoffrey Keating * doc/install.texi (Prerequisites): Mention that perl is needed diff --git a/gcc/varasm.c b/gcc/varasm.c index 3ef81468850..88068b5205c 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1274,11 +1274,13 @@ assemble_start_function (tree decl, const char *fnname) unlikely_text_section (); assemble_align (FUNCTION_BOUNDARY); ASM_OUTPUT_LABEL (asm_out_file, cfun->cold_section_label); - if (BB_PARTITION (ENTRY_BLOCK_PTR->next_bb) == BB_COLD_PARTITION) + + /* When the function starts with a cold section, we need to explicitly + align the hot section and write out the hot section label. + But if the current function is a thunk, we do not have a CFG. */ + if (!current_function_is_thunk + && BB_PARTITION (ENTRY_BLOCK_PTR->next_bb) == BB_COLD_PARTITION) { - /* Since the function starts with a cold section, we need to - explicitly align the hot section and write out the hot - section label. */ text_section (); assemble_align (FUNCTION_BOUNDARY); ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label); @@ -1361,7 +1363,10 @@ assemble_start_function (tree decl, const char *fnname) ASM_OUTPUT_LABEL (asm_out_file, fnname); #endif /* ASM_DECLARE_FUNCTION_NAME */ - insert_section_boundary_note (); + /* Add NOTE_INSN_SWITCH_TEXT_SECTIONS notes. Don't do this if the current + function is a thunk, because we don't have a CFG in that case. */ + if (!current_function_is_thunk) + insert_section_boundary_note (); } /* Output assembler code associated with defining the size of the -- 2.30.2