aboutsummaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@gcc.gnu.org>2001-05-05 09:38:25 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-05-05 09:38:25 -0700
commit45053eaf0b43e8a9085e20cf52e589cf0aa6aef3 (patch)
tree61cc8b37ca09150a483556195e12fa6db9cbc06e /gcc/except.c
parent2a9071bb2f453b5d36ea3149c36ac27df57629fd (diff)
downloadgcc-45053eaf0b43e8a9085e20cf52e589cf0aa6aef3.zip
gcc-45053eaf0b43e8a9085e20cf52e589cf0aa6aef3.tar.gz
gcc-45053eaf0b43e8a9085e20cf52e589cf0aa6aef3.tar.bz2
except.c (remove_fixup_regions): Adjust REG_EH_REGION notes to the parent of the fixup region.
* except.c (remove_fixup_regions): Adjust REG_EH_REGION notes to the parent of the fixup region. From-SVN: r41867
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/except.c b/gcc/except.c
index a015812..b21769c 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -1101,11 +1101,30 @@ static void
remove_fixup_regions ()
{
int i;
+ rtx insn, note;
+ struct eh_region *fixup;
+ /* Walk the insn chain and adjust the REG_EH_REGION numbers
+ for instructions referencing fixup regions. This is only
+ strictly necessary for fixup regions with no parent, but
+ doesn't hurt to do it for all regions. */
+ for (insn = get_insns(); insn ; insn = NEXT_INSN (insn))
+ if (INSN_P (insn)
+ && (note = find_reg_note (insn, REG_EH_REGION, NULL))
+ && INTVAL (XEXP (note, 0)) > 0
+ && (fixup = cfun->eh->region_array[INTVAL (XEXP (note, 0))])
+ && fixup->type == ERT_FIXUP)
+ {
+ if (fixup->u.fixup.real_region)
+ XEXP (note, 1) = GEN_INT (fixup->u.fixup.real_region->region_number);
+ else
+ remove_note (insn, note);
+ }
+
+ /* Remove the fixup regions from the tree. */
for (i = cfun->eh->last_region_number; i > 0; --i)
{
- struct eh_region *fixup = cfun->eh->region_array[i];
-
+ fixup = cfun->eh->region_array[i];
if (! fixup)
continue;