Commit 9ad8a5f0 by Mike Stump Committed by Jeff Law

except.c (expand_ex_region_start_for_decl): Emit EH_REGION_BEG notes for sjlj exceptions too.

        * except.c (expand_ex_region_start_for_decl): Emit EH_REGION_BEG
        notes for sjlj exceptions too.
        (expand_eh_region_end): Similarly for EH_REGION_END notes.
        (exception_optimize): Optimize EH regions for sjlj exceptions too.
        * final.c (final_scan_insn): Don't output labels for EH REGION
        notes if doing sjlj exceptions.

From-SVN: r16266
parent f8671389
Sat Nov 1 21:43:00 1997 Mike Stump (mrs@wrs.com)
* except.c (expand_ex_region_start_for_decl): Emit EH_REGION_BEG
notes for sjlj exceptions too.
(expand_eh_region_end): Similarly for EH_REGION_END notes.
(exception_optimize): Optimize EH regions for sjlj exceptions too.
* final.c (final_scan_insn): Don't output labels for EH REGION
notes if doing sjlj exceptions.
Sat Nov 1 19:15:28 1997 Jeffrey A Law (law@cygnus.com) Sat Nov 1 19:15:28 1997 Jeffrey A Law (law@cygnus.com)
* flow.c (find_basic_blocks): If we delete the label for an * flow.c (find_basic_blocks): If we delete the label for an
......
...@@ -1032,12 +1032,10 @@ expand_eh_region_start_for_decl (decl) ...@@ -1032,12 +1032,10 @@ expand_eh_region_start_for_decl (decl)
expand_dhc_cleanup (decl); expand_dhc_cleanup (decl);
} }
if (exceptions_via_longjmp == 0)
note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_BEG);
push_eh_entry (&ehstack); push_eh_entry (&ehstack);
if (exceptions_via_longjmp == 0) note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_BEG);
NOTE_BLOCK_NUMBER (note) NOTE_BLOCK_NUMBER (note)
= CODE_LABEL_NUMBER (ehstack.top->entry->exception_handler_label); = CODE_LABEL_NUMBER (ehstack.top->entry->exception_handler_label);
if (exceptions_via_longjmp) if (exceptions_via_longjmp)
start_dynamic_handler (); start_dynamic_handler ();
} }
...@@ -1066,17 +1064,19 @@ expand_eh_region_end (handler) ...@@ -1066,17 +1064,19 @@ expand_eh_region_end (handler)
tree handler; tree handler;
{ {
struct eh_entry *entry; struct eh_entry *entry;
rtx note;
if (! doing_eh (0)) if (! doing_eh (0))
return; return;
entry = pop_eh_entry (&ehstack); entry = pop_eh_entry (&ehstack);
note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_END);
NOTE_BLOCK_NUMBER (note)
= CODE_LABEL_NUMBER (entry->exception_handler_label);
if (exceptions_via_longjmp == 0) if (exceptions_via_longjmp == 0)
{ {
rtx label; rtx label;
rtx note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_END);
NOTE_BLOCK_NUMBER (note) = CODE_LABEL_NUMBER (entry->exception_handler_label);
label = gen_label_rtx (); label = gen_label_rtx ();
emit_jump (label); emit_jump (label);
...@@ -2136,10 +2136,6 @@ exception_optimize () ...@@ -2136,10 +2136,6 @@ exception_optimize ()
rtx insn, regions = NULL_RTX; rtx insn, regions = NULL_RTX;
int n; int n;
/* The below doesn't apply to setjmp/longjmp EH. */
if (exceptions_via_longjmp)
return;
/* Remove empty regions. */ /* Remove empty regions. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{ {
......
...@@ -1379,7 +1379,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) ...@@ -1379,7 +1379,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END) if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END)
break; break;
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG) if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG
&& ! exceptions_via_longjmp)
{ {
ASM_OUTPUT_INTERNAL_LABEL (file, "LEHB", NOTE_BLOCK_NUMBER (insn)); ASM_OUTPUT_INTERNAL_LABEL (file, "LEHB", NOTE_BLOCK_NUMBER (insn));
add_eh_table_entry (NOTE_BLOCK_NUMBER (insn)); add_eh_table_entry (NOTE_BLOCK_NUMBER (insn));
...@@ -1389,7 +1390,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) ...@@ -1389,7 +1390,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
break; break;
} }
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END) if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END
&& ! exceptions_via_longjmp)
{ {
ASM_OUTPUT_INTERNAL_LABEL (file, "LEHE", NOTE_BLOCK_NUMBER (insn)); ASM_OUTPUT_INTERNAL_LABEL (file, "LEHE", NOTE_BLOCK_NUMBER (insn));
#ifdef ASM_OUTPUT_EH_REGION_END #ifdef ASM_OUTPUT_EH_REGION_END
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment