]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/tree-nrv.c
Merger of git branch "gimple-classes-v2-option-3"
[thirdparty/gcc.git] / gcc / tree-nrv.c
index 7798bd74f9214e0d97dec3fc7daf5643abc6a98b..182039edc0d7a5c47edca4492b1da202068b5a07 100644 (file)
@@ -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)),