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: "rakdver at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jan 2006 18:34:46 -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 #9 from rakdver at gcc dot gnu dot org 2006-01-02 18:34 -------
As the comments in gimplify_cleanup_point_expr indicate,
it only handles cases when cleanup_exprs are not within nested
constructs (with the exception of conditions).
In this PR, the code basically looks like
cleanup_point_expr
{
...
try
{
tmp = b ? target_expr (bla1, something, cleanup1) : target_expr (bla2,
something, cleanup2)
}
catch {...}
throw (tmp);
}
The target_exprs expand cleanups to cleanup_exprs, that however are not spotted
by gimplify_cleanup_point_expr, since they are within try_catch_expr.
The reason why this does not reproduce without the test for b is that then the
code
looks like
cleanup_point_expr
{
...
try
{
tmp = target_expr (bla1, something, cleanup1);
}
catch {...}
throw (tmp);
}
and there is another bug in gimplify_modify_expr_rhs that causes cleanup1
to be ignored.
Fixing this seems to need a complete rewrite of gimplify_cleanup_point_expr.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24996