Commit 4832214a by Jason Merrill Committed by Jason Merrill

re PR c++/28899 (gimplification failed)

        PR c++/28899
        * gimplify.c (gimplify_modify_expr_rhs) [BIND_EXPR]: Handle
        want_value.

        * gimplify.c (voidify_wrapper_expr): Handle null type.

From-SVN: r116637
parent a56913dd
2006-09-01 Jason Merrill <jason@redhat.com>
PR c++/28899
* gimplify.c (gimplify_modify_expr_rhs) [BIND_EXPR]: Handle
want_value.
* gimplify.c (voidify_wrapper_expr): Handle null type.
2006-09-01 Josh Conner <jconner@apple.com> 2006-09-01 Josh Conner <jconner@apple.com>
PR c++/25505 PR c++/25505
......
...@@ -955,9 +955,9 @@ gimple_build_eh_filter (tree body, tree allowed, tree failure) ...@@ -955,9 +955,9 @@ gimple_build_eh_filter (tree body, tree allowed, tree failure)
tree tree
voidify_wrapper_expr (tree wrapper, tree temp) voidify_wrapper_expr (tree wrapper, tree temp)
{ {
if (!VOID_TYPE_P (TREE_TYPE (wrapper))) tree type = TREE_TYPE (wrapper);
if (type && !VOID_TYPE_P (type))
{ {
tree type = TREE_TYPE (wrapper);
tree *p; tree *p;
/* Set p to point to the body of the wrapper. Loop until we find /* Set p to point to the body of the wrapper. Loop until we find
...@@ -3415,10 +3415,23 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p, ...@@ -3415,10 +3415,23 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p,
case STATEMENT_LIST: case STATEMENT_LIST:
{ {
tree wrap = *from_p; tree wrap = *from_p;
tree t = voidify_wrapper_expr (wrap, *expr_p); tree t;
ret = gimplify_expr (to_p, pre_p, post_p,
is_gimple_min_lval, fb_lvalue);
if (ret != GS_ERROR)
ret = GS_OK;
t = voidify_wrapper_expr (wrap, *expr_p);
gcc_assert (t == *expr_p); gcc_assert (t == *expr_p);
*expr_p = wrap; if (want_value)
{
gimplify_and_add (wrap, pre_p);
*expr_p = unshare_expr (*to_p);
}
else
*expr_p = wrap;
return GS_OK; return GS_OK;
} }
......
// PR c++/28899
// { dg-options "" }
void f()
{
unsigned l, l1;
l1 = l = ({ unsigned __v; __v; });
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment