2007-07-30 Diego Novillo * gimplify.c (get_tmp_var_for): When creating a new temporary for a GIMPLE_CALL, use the type returned by the function call instead of the type of the function decl. * gimple.c (build_gimple_return): Accept NULL and RESULT_DECL return values. Index: gimplify.c =================================================================== --- gimplify.c (revision 127067) +++ gimplify.c (working copy) @@ -640,7 +640,8 @@ get_tmp_var_for (gimple stmt) if (code == GIMPLE_ASSIGN) return create_tmp_from_val (gimple_assign_operand (stmt, 1)); else if (code == GIMPLE_CALL) - return create_tmp_from_val (gimple_call_fn (stmt)); + return create_tmp_var (TREE_TYPE (TREE_TYPE (gimple_call_fn (stmt))), + get_name (gimple_call_fn (stmt))); else gcc_unreachable (); Index: gimple.c =================================================================== --- gimple.c (revision 127018) +++ gimple.c (working copy) @@ -145,7 +145,9 @@ gimple build_gimple_return (bool result_decl_p, tree retval) { gimple s = build_gimple_with_ops (GIMPLE_RETURN, (int) result_decl_p, 1); - gcc_assert (is_gimple_val (retval)); + gcc_assert (retval == NULL_TREE + || TREE_CODE (retval) == RESULT_DECL + || is_gimple_val (retval)); gimple_return_set_retval (s, retval); return s; }