Message ID | alpine.LNX.2.00.1006281311510.1429@zhemvz.fhfr.qr |
---|---|
State | New |
Headers | show |
On 06/28/2010 07:14 AM, Richard Guenther wrote:
> + else if ((is_gimple_lvalue (op1) || INDIRECT_REF_P (op1))
is_gimple_lvalue returns true for INDIRECT_REF, you don't need to check
INDIRECT_REF_P as well. OK with that change.
Jason
On Mon, 28 Jun 2010, Jason Merrill wrote: > On 06/28/2010 07:14 AM, Richard Guenther wrote: > > + else if ((is_gimple_lvalue (op1) || INDIRECT_REF_P (op1)) > > is_gimple_lvalue returns true for INDIRECT_REF, you don't need to check > INDIRECT_REF_P as well. OK with that change. It doesn't. INDIRECT_REF isn't a valid gimple lvalue on the branch, but you still see it here due to the call half-way inbetween gimplifying. Richard.
On 06/28/2010 10:52 AM, Richard Guenther wrote: > On Mon, 28 Jun 2010, Jason Merrill wrote: > >> On 06/28/2010 07:14 AM, Richard Guenther wrote: >>> + else if ((is_gimple_lvalue (op1) || INDIRECT_REF_P (op1)) >> >> is_gimple_lvalue returns true for INDIRECT_REF, you don't need to check >> INDIRECT_REF_P as well. OK with that change. > > It doesn't. INDIRECT_REF isn't a valid gimple lvalue on the branch, > but you still see it here due to the call half-way inbetween > gimplifying. Interesting. OK. Jason
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)))