This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
exception-section patch, part 8
- To: egcs-patches at cygnus dot com
- Subject: exception-section patch, part 8
- From: Bruno Haible <haible at ilog dot fr>
- Date: Wed, 1 Jul 1998 00:32:15 +0200 (MET DST)
This patch causes NOTE_INSN_EH_HANDLER_{BEG,END} notes to be emitted around:
- rethrow stubs,
- cleanup code,
- a C++ TRY's exception blocks.
Sun Jun 28 19:49:33 1998 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
* except.c (expand_eh_region_end): Enclose the rethrow stub in
EH_HANDLER notes.
* function.c (expand_function_end): Enclose the cleanup code in
EH_HANDLER notes.
For cp/ChangeLog:
Sun Jun 28 19:49:33 1998 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
* except.c (expand_exception_blocks): Enclose a TRY's exception
blocks in EH_HANDLER notes.
diff -c3p egcs-19980628/gcc/except.c.bak egcs-19980628/gcc/except.c
*** egcs-19980628/gcc/except.c.bak Thu Jun 25 16:11:47 1998
--- egcs-19980628/gcc/except.c Tue Jun 30 13:08:35 1998
*************** expand_eh_region_end (handler)
*** 1408,1418 ****
--- 1411,1425 ----
label = gen_label_rtx ();
emit_jump (label);
+ emit_note (NULL_PTR, NOTE_INSN_EH_HANDLER_BEG);
+
/* Emit a label marking the end of this exception region that
is used for rethrowing into the outer context. */
emit_label (entry->outer_context);
expand_internal_throw ();
+ emit_note (NULL_PTR, NOTE_INSN_EH_HANDLER_END);
+
emit_label (label);
}
diff -c3p egcs-19980628/gcc/function.c.bak egcs-19980628/gcc/function.c
*** egcs-19980628/gcc/function.c.bak Thu Jun 25 17:14:27 1998
--- egcs-19980628/gcc/function.c Tue Jun 30 13:06:49 1998
*************** expand_function_end (filename, line, end
*** 5841,5853 ****
created for the parameters. */
{
rtx last = get_last_insn ();
- rtx label;
expand_leftover_cleanups ();
/* If the above emitted any code, may sure we jump around it. */
if (last != get_last_insn ())
{
label = gen_label_rtx ();
last = emit_jump_insn_after (gen_jump (label), last);
last = emit_barrier_after (last);
--- 5841,5859 ----
created for the parameters. */
{
rtx last = get_last_insn ();
expand_leftover_cleanups ();
/* If the above emitted any code, may sure we jump around it. */
if (last != get_last_insn ())
{
+ rtx label;
+
+ /* If flag_extra_section_for_exceptions is on, the cleanup code will
+ be moved to the eh_text section, and if we aren't already in the
+ eh_text section, the jump will be eliminated in final.c. */
+ emit_note_after (NOTE_INSN_EH_HANDLER_BEG, last);
+ emit_note (NULL_PTR, NOTE_INSN_EH_HANDLER_END);
label = gen_label_rtx ();
last = emit_jump_insn_after (gen_jump (label), last);
last = emit_barrier_after (last);
diff -c3p egcs-19980628/gcc/cp/except.c.bak egcs-19980628/gcc/cp/except.c
*** egcs-19980628/gcc/cp/except.c.bak Thu Jun 25 16:11:52 1998
--- egcs-19980628/gcc/cp/except.c Tue Jun 30 13:06:49 1998
*************** expand_exception_blocks ()
*** 969,974 ****
--- 969,979 ----
rtx funcend = gen_label_rtx ();
emit_jump (funcend);
+ /* If flag_extra_section_for_exceptions is on, the cleanup code will
+ be moved to the eh_text section, and if we aren't already in the
+ eh_text section, the jump will be eliminated in final.c. */
+ emit_note (NULL_PTR, NOTE_INSN_EH_HANDLER_BEG);
+
/* We cannot protect n regions this way if we must flow into the
EH region through the top of the region, as we have to with
the setjmp/longjmp approach. */
*************** expand_exception_blocks ()
*** 982,987 ****
--- 987,994 ----
expand_eh_region_end (build_terminate_handler ());
expand_leftover_cleanups ();
+
+ emit_note (NULL_PTR, NOTE_INSN_EH_HANDLER_END);
emit_label (funcend);
}