This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24996] [4.0/4.1/4.2 Regression] ICE on throw code
- From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2006 05:10:58 -0000
- Subject: [Bug c++/24996] [4.0/4.1/4.2 Regression] ICE on throw code
- References: <bug-24996-8383@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from mmitchel at gcc dot gnu dot org 2006-01-23 05:10 -------
I don't fully understand stabilize_expr; that's Jason's invention, IIRC.
However, I think that the problem is that for a COND_EXPR we can't pre-evaluate
both arms of the conditional, because only one of them is supposed to be
executed at runtime.
I think this is a bug in the gimplifier. I certainly don't see anything in the
documentation for CLEANUP_EXPR that suggests the restriction you've described.
I suppose that we could try to turn:
b ? T(x) : T(y)
into:
SAVE_EXPR b,
TARGET_EXPR (tmp, b ? T(&tmp, x) : T(&tmp, y), b ? cleanup1 : cleanup2)
but that seems difficult, and I'm not sure it would work.
By the way, here's a simpler test case:
struct A {
A();
~A();
};
struct S {
S(const A&);
~S();
};
void foo(bool b)
{
throw b ? S(A()) : throw 0;
}
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24996