From patchwork Mon Jun 28 11:14:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [C++] mem-ref2 merge, C++ gimplification change X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 57131 Message-Id: To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com Date: Mon, 28 Jun 2010 13:14:18 +0200 (CEST) From: Richard Guenther List-Id: This is the only non-middle-end piece of the mem-ref2 merge. As we iterate through cp_gimplify_expr on different states of gimplification and still expect un-gimplified pieces we also have to still expect INDIRECT_REFs. So we can't use a predicate that is supposed to match fully gimplified state. Ok for trunk together with the mem-ref2 merge? Thanks, Richard. cp/ * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs predicate we are looking for, allow non-gimplified INDIRECT_REFs. Index: gcc/cp/cp-gimplify.c =================================================================== --- gcc/cp/cp-gimplify.c (.../trunk) (revision 161367) +++ gcc/cp/cp-gimplify.c (.../branches/mem-ref2) (revision 161369) @@ -575,7 +575,7 @@ cp_gimplify_expr (tree *expr_p, gimple_s TREE_OPERAND (*expr_p, 1) = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (op0), op1); - else if ((rhs_predicate_for (op0)) (op1) + else if ((is_gimple_lvalue (op1) || INDIRECT_REF_P (op1)) && !(TREE_CODE (op1) == CALL_EXPR && CALL_EXPR_RETURN_SLOT_OPT (op1)) && is_really_empty_class (TREE_TYPE (op0)))