This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12491] [3.3/3.4 Regression] [eh] Destructor fails to compile when optimizations (inlining) are enabled
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Dec 2003 09:18:12 -0000
- Subject: [Bug c++/12491] [3.3/3.4 Regression] [eh] Destructor fails to compile when optimizations (inlining) are enabled
- References: <20031002113610.12491.harizak@speech.gr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From ebotcazou at gcc dot gnu dot org 2003-12-06 09:18 -------
Thanks for the clarification. I dug deeper and I'm now convinced that it's an EH
problem: we have 6 EH regions, laid out as follows:
fixup cleanup
2 --> 1
| \
| \
4 --> 3
| \
| \
6 --> 5
where --> stands for 'peer' and non-horizontal edges stand for 'inner'/'outer'.
The problem is that the real_region of R4 is R2, which is also a fixup region
and thus is eliminated.
The following patch cures the ICE but I'd like confirmation by an EH specialist
that it is sane:
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.254
diff -u -p -r1.254 except.c
--- except.c 14 Nov 2003 10:44:08 -0000 1.254
+++ except.c 6 Dec 2003 09:05:00 -0000
@@ -937,8 +937,13 @@ remove_fixup_regions (void)
&& (fixup = cfun->eh->region_array[INTVAL (XEXP (note, 0))])
&& fixup->type == ERT_FIXUP)
{
- if (fixup->u.fixup.real_region)
- XEXP (note, 0) = GEN_INT (fixup->u.fixup.real_region->region_number);
+ /* Walk up the chain of fixup regions. */
+ do {
+ fixup = fixup->u.fixup.real_region;
+ } while (fixup && fixup->type == ERT_FIXUP);
+
+ if (fixup)
+ XEXP (note, 0) = GEN_INT (fixup->region_number);
else
remove_note (insn, note);
}
[Mike, I CCed you because you're the author of except.c]
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mrs at apple dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12491