This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
bb-reorder clobbers EH
- To: gcc-patches at gcc dot gnu dot org
- Subject: bb-reorder clobbers EH
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Mon, 4 Dec 2000 21:25:24 +1100 (EST)
A comment in reorder_basic_blocks says
"We do not currently handle correct re-placement of EH notes."
I guess that includes losing the EH region end note, which causes a segv
in set_insn_eh_region.
* except.c (set_insn_eh_region): Abort if EH region end note
missing.
* jump.c (jump_optimize_1): Don't do EH processing if
exceptions_via_longjmp.
* final.c (final): Likewise.
Alan Modra
--
Linuxcare. Support for the Revolution.
--- gcc/except.c~ Mon Dec 4 14:11:37 2000
+++ gcc/except.c Mon Dec 4 20:32:20 2000
@@ -3174,6 +3174,8 @@ set_insn_eh_region (first, region_num)
insn = NEXT_INSN (insn);
set_insn_eh_region (&insn, rnum);
/* Upon return, insn points to the EH_REGION_END of nested region */
+ if (!insn)
+ abort ();
continue;
}
insn_eh_region[INSN_UID (insn)] = region_num;
--- gcc/jump.c~ Fri Dec 1 15:53:22 2000
+++ gcc/jump.c Mon Dec 4 20:47:23 2000
@@ -215,7 +215,7 @@ jump_optimize_1 (f, cross_jump, noop_mov
/* If we are performing cross jump optimizations, then initialize
tables mapping UIDs to EH regions to avoid incorrect movement
of insns from one EH region to another. */
- if (flag_exceptions && cross_jump)
+ if (flag_exceptions && ! exceptions_via_longjmp && cross_jump)
init_insn_eh_region (f, max_uid);
if (! mark_labels_only)
@@ -250,7 +250,7 @@ jump_optimize_1 (f, cross_jump, noop_mov
if (mark_labels_only)
goto end;
- if (! minimal)
+ if (! minimal && ! exceptions_via_longjmp)
exception_optimize ();
last_insn = delete_unreferenced_labels (f);
--- gcc/final.c~ Sat Dec 2 20:49:06 2000
+++ gcc/final.c Mon Dec 4 20:49:07 2000
@@ -2012,7 +2012,8 @@ final (first, file, optimize, prescan)
/* Initialize insn_eh_region table if eh is being used. */
- init_insn_eh_region (first, max_uid);
+ if (! exceptions_via_longjmp)
+ init_insn_eh_region (first, max_uid);
init_recog ();