Lines 320-329
simple_empty_class_p (tree type, tree op
Link Here
|
320 |
{ |
320 |
{ |
321 |
if (TREE_CODE (op) == COMPOUND_EXPR) |
321 |
if (TREE_CODE (op) == COMPOUND_EXPR) |
322 |
return simple_empty_class_p (type, TREE_OPERAND (op, 1), code); |
322 |
return simple_empty_class_p (type, TREE_OPERAND (op, 1), code); |
323 |
if (SIMPLE_TARGET_EXPR_P (op) |
|
|
324 |
&& TYPE_HAS_TRIVIAL_DESTRUCTOR (type)) |
325 |
/* The TARGET_EXPR is itself a simple copy, look through it. */ |
326 |
return simple_empty_class_p (type, TARGET_EXPR_INITIAL (op), code); |
327 |
|
323 |
|
328 |
if (TREE_CODE (op) == PARM_DECL |
324 |
if (TREE_CODE (op) == PARM_DECL |
329 |
&& TREE_ADDRESSABLE (TREE_TYPE (op))) |
325 |
&& TREE_ADDRESSABLE (TREE_TYPE (op))) |
Lines 473-483
cp_gimplify_expr (tree *expr_p, gimple_s
Link Here
|
473 |
|
469 |
|
474 |
else if (simple_empty_class_p (TREE_TYPE (op0), op1, code)) |
470 |
else if (simple_empty_class_p (TREE_TYPE (op0), op1, code)) |
475 |
{ |
471 |
{ |
476 |
while (TREE_CODE (op1) == TARGET_EXPR) |
|
|
477 |
/* We're disconnecting the initializer from its target, |
478 |
don't create a temporary. */ |
479 |
op1 = TARGET_EXPR_INITIAL (op1); |
480 |
|
481 |
/* Remove any copies of empty classes. Also drop volatile |
472 |
/* Remove any copies of empty classes. Also drop volatile |
482 |
variables on the RHS to avoid infinite recursion from |
473 |
variables on the RHS to avoid infinite recursion from |
483 |
gimplify_expr trying to load the value. */ |
474 |
gimplify_expr trying to load the value. */ |
Lines 492-500
cp_gimplify_expr (tree *expr_p, gimple_s
Link Here
|
492 |
gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, |
483 |
gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, |
493 |
is_gimple_lvalue, fb_lvalue); |
484 |
is_gimple_lvalue, fb_lvalue); |
494 |
*expr_p = TREE_OPERAND (*expr_p, 0); |
485 |
*expr_p = TREE_OPERAND (*expr_p, 0); |
495 |
if (code == RETURN_EXPR && REFERENCE_CLASS_P (*expr_p)) |
|
|
496 |
/* Avoid 'return *<retval>;' */ |
497 |
*expr_p = TREE_OPERAND (*expr_p, 0); |
498 |
} |
486 |
} |
499 |
/* P0145 says that the RHS is sequenced before the LHS. |
487 |
/* P0145 says that the RHS is sequenced before the LHS. |
500 |
gimplify_modify_expr gimplifies the RHS before the LHS, but that |
488 |
gimplify_modify_expr gimplifies the RHS before the LHS, but that |
Lines 674-679
cp_gimplify_expr (tree *expr_p, gimple_s
Link Here
|
674 |
|| TREE_CODE (TREE_OPERAND (*expr_p, 0)) == MODIFY_EXPR)) |
662 |
|| TREE_CODE (TREE_OPERAND (*expr_p, 0)) == MODIFY_EXPR)) |
675 |
{ |
663 |
{ |
676 |
expr_p = &TREE_OPERAND (*expr_p, 0); |
664 |
expr_p = &TREE_OPERAND (*expr_p, 0); |
|
|
665 |
code = TREE_CODE (*expr_p); |
677 |
/* Avoid going through the INIT_EXPR case, which can |
666 |
/* Avoid going through the INIT_EXPR case, which can |
678 |
degrade INIT_EXPRs into AGGR_INIT_EXPRs. */ |
667 |
degrade INIT_EXPRs into AGGR_INIT_EXPRs. */ |
679 |
goto modify_expr_case; |
668 |
goto modify_expr_case; |