summaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-03-07 15:54:59 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-03-07 15:54:59 +0000
commitb78b513e41b3d491efa0bd639cedbad8622a09bd (patch)
tree5043355c1914fa0a327adcad08751d898419f92f /gcc/except.c
parent123ba0918c9ba27eeba43c885854a553e2b8b6f7 (diff)
re PR target/84277 (A lot of new acats testsuite failures)
PR target/84277 * except.h (output_function_exception_table): Adjust prototype. * except.c (output_function_exception_table): Remove FNNAME parameter and add SECTION parameter. Ouput one part of the table at a time. * final.c (final_scan_insn_1) <NOTE_INSN_SWITCH_TEXT_SECTIONS>: Output the first part of the exception table and emit unwind directives. * config/i386/i386-protos.h (i386_pe_end_cold_function): Declare. (i386_pe_seh_cold_init): Likewise. * config/i386/cygming.h (ASM_DECLARE_COLD_FUNCTION_NAME): New macro. (ASM_DECLARE_COLD_FUNCTION_SIZE): Likewise. * config/i386/i386.c (x86_expand_epilogue): Fix wording in comment. (ix86_output_call_insn): Emit a nop in one more case for SEH. * config/i386/winnt.c: Include except.h. (struct seh_frame_state): Add reg_offset, after_prologue and in_cold_section fields. (i386_pe_seh_end_prologue): Set seh->after_prologue. (i386_pe_seh_cold_init): New function. (i386_pe_seh_fini): Add COLD parameter and bail out if it is not equal to seh->in_cold_section. (seh_emit_push): Record the offset of the push. (seh_emit_save): Record the offet of the save. (i386_pe_seh_unwind_emit): Deal with NOTE_INSN_SWITCH_TEXT_SECTIONS. Test seh->after_prologue to disregard the epilogue. (i386_pe_end_function): Pass FALSE to i386_pe_seh_fini. (i386_pe_end_cold_function): New function. From-SVN: r258338
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/gcc/except.c b/gcc/except.c
index 04d4764ee17..53e57732ea8 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -2939,7 +2939,6 @@ switch_to_exception_section (const char * ARG_UNUSED (fnname))
switch_to_section (s);
}
-
/* Output a reference from an exception table to the type_info object TYPE.
TT_FORMAT and TT_FORMAT_SIZE describe the DWARF encoding method used for
the value. */
@@ -2989,6 +2988,13 @@ output_ttype (tree type, int tt_format, int tt_format_size)
dw2_asm_output_encoded_addr_rtx (tt_format, value, is_public, NULL);
}
+/* Output an exception table for the current function according to SECTION.
+
+ If the function has been partitioned into hot and cold parts, value 0 for
+ SECTION refers to the table associated with the hot part while value 1
+ refers to the table associated with the cold part. If the function has
+ not been partitioned, value 0 refers to the single exception table. */
+
static void
output_one_function_exception_table (int section)
{
@@ -3167,13 +3173,26 @@ output_one_function_exception_table (int section)
}
}
+/* Output an exception table for the current function according to SECTION,
+ switching back and forth from the function section appropriately.
+
+ If the function has been partitioned into hot and cold parts, value 0 for
+ SECTION refers to the table associated with the hot part while value 1
+ refers to the table associated with the cold part. If the function has
+ not been partitioned, value 0 refers to the single exception table. */
+
void
-output_function_exception_table (const char *fnname)
+output_function_exception_table (int section)
{
+ const char *fnname = get_fnname_from_decl (current_function_decl);
rtx personality = get_personality_function (current_function_decl);
/* Not all functions need anything. */
- if (! crtl->uses_eh_lsda)
+ if (!crtl->uses_eh_lsda)
+ return;
+
+ /* No need to emit any boilerplate stuff for the cold part. */
+ if (section == 1 && !crtl->eh.call_site_record_v[1])
return;
if (personality)
@@ -3189,9 +3208,8 @@ output_function_exception_table (const char *fnname)
/* If the target wants a label to begin the table, emit it here. */
targetm.asm_out.emit_except_table_label (asm_out_file);
- output_one_function_exception_table (0);
- if (crtl->eh.call_site_record_v[1])
- output_one_function_exception_table (1);
+ /* Do the real work. */
+ output_one_function_exception_table (section);
switch_to_section (current_function_section ());
}