This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] PATCH for c++/13033
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 14 Nov 2003 03:08:44 -0500
- Subject: [tree-ssa] PATCH for c++/13033
Thanks to rth for telling me what the problem was; we were failing to wrap
the for increment expression in a CLEANUP_POINT_EXPR, so cleanup
gimplification was falling over.
Tested athlon-pc-linux-gnu, applied to tree-ssa. Test in
g++.dg/init/cleanup1.C.
2003-11-14 Jason Merrill <jason@redhat.com>
PR c++/13033
* c-simplify.c (gimplify_c_loop): Wrap the increment in a
CLEANUP_POINT_EXPR.
*** c-simplify.c.~1~ 2003-11-12 11:02:34.000000000 -0500
--- c-simplify.c 2003-11-13 16:06:40.000000000 -0500
*************** gimplify_c_loop (tree cond, tree body, t
*** 672,677 ****
--- 672,679 ----
cont_block = begin_bc_block (bc_continue);
gimplify_stmt (&body);
+ if (incr && stmts_are_full_exprs_p ())
+ incr = fold (build1 (CLEANUP_POINT_EXPR, void_type_node, incr));
gimplify_stmt (&incr);
body = finish_bc_block (cont_block, body);