From patchwork Mon Jun 28 12:37:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: PR tree-optimization/44687 (partial inlining and nrv at i386) Date: Mon, 28 Jun 2010 02:37:05 -0000 From: Jan Hubicka X-Patchwork-Id: 57135 Message-Id: <20100628123705.GA6233@kam.mff.cuni.cz> To: gcc-patches@gcc.gnu.org Hi, the problem here is that ipa-split when building new return statement it use ordinary var to pass return value where RESULT_DECL is expected. Fixed thus. It might be nice to extend statement verifier to check this, but I am not sure when exactly we insist on RESULT_DECL and when not. (for aggregates or in more complex scenarios?) Bootstrapped/regtested x86_64-linux, OK? Honza typedef int int32_t; typedef unsigned char uint8_t; struct S0 { uint8_t f0; }; struct S0 *g_18[7][5][1][1] = { }; struct S0 **g_17 = &g_18[0][3][0][0]; int32_t g_86; struct S0 func_72 (uint8_t p_73, struct S0 p_74); void int326 (struct S0 **p_67, int32_t p_68, int32_t * *const p_69, struct S0 *p_70) { struct S0 l_95 = { -1L }; func_72 (1L, func_72 (0, l_95)); } struct S0 func_72 (uint8_t p_73, struct S0 p_74) { int32_t *l_85 = &g_86; if (*l_85) lbl_94:*l_85 ^= 0; if (g_86) goto lbl_94; return **g_17; } PR tree-optimization/44687 * ipa-split.c (split_function): Use DECL_RESULT to store return value. Index: ipa-split.c =================================================================== --- ipa-split.c (revision 161476) +++ ipa-split.c (working copy) @@ -928,9 +928,7 @@ split_function (struct split_point *spli gimple ret; if (!VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl)))) { - retval - = create_tmp_var (TREE_TYPE (TREE_TYPE (current_function_decl)), - "RET"); + retval = DECL_RESULT (current_function_decl); if (is_gimple_reg (retval)) retval = make_ssa_name (retval, call); gimple_call_set_lhs (call, retval);