diff options
Diffstat (limited to 'gcc/tree-nrv.c')
-rw-r--r-- | gcc/tree-nrv.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c index 7798bd74f92..182039edc0d 100644 --- a/gcc/tree-nrv.c +++ b/gcc/tree-nrv.c @@ -189,12 +189,12 @@ pass_nrv::execute (function *fun) gimple stmt = gsi_stmt (gsi); tree ret_val; - if (gimple_code (stmt) == GIMPLE_RETURN) + if (greturn *return_stmt = dyn_cast <greturn *> (stmt)) { /* In a function with an aggregate return value, the gimplifier has changed all non-empty RETURN_EXPRs to return the RESULT_DECL. */ - ret_val = gimple_return_retval (stmt); + ret_val = gimple_return_retval (return_stmt); if (ret_val) gcc_assert (ret_val == result); } @@ -324,7 +324,7 @@ make_pass_nrv (gcc::context *ctxt) DEST is available if it is not clobbered or used by the call. */ static bool -dest_safe_for_nrv_p (gimple call) +dest_safe_for_nrv_p (gcall *call) { tree dest = gimple_call_lhs (call); @@ -391,10 +391,11 @@ pass_return_slot::execute (function *fun) gimple_stmt_iterator gsi; for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) { - gimple stmt = gsi_stmt (gsi); + gcall *stmt; bool slot_opt_p; - if (is_gimple_call (stmt) + stmt = dyn_cast <gcall *> (gsi_stmt (gsi)); + if (stmt && gimple_call_lhs (stmt) && !gimple_call_return_slot_opt_p (stmt) && aggregate_value_p (TREE_TYPE (gimple_call_lhs (stmt)), |