From patchwork Mon Jun 28 12:37:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 57135 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id E8317B6EEE for ; Mon, 28 Jun 2010 22:37:18 +1000 (EST) Received: (qmail 29317 invoked by alias); 28 Jun 2010 12:37:16 -0000 Received: (qmail 29301 invoked by uid 22791); 28 Jun 2010 12:37:14 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_NR, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Jun 2010 12:37:08 +0000 Received: from localhost (occam.ms.mff.cuni.cz [195.113.18.121]) by nikam.ms.mff.cuni.cz (Postfix) with ESMTP id AC7E39AC86F for ; Mon, 28 Jun 2010 14:37:05 +0200 (CEST) Received: by localhost (Postfix, from userid 16202) id 9D9E356415F; Mon, 28 Jun 2010 14:37:05 +0200 (CEST) Date: Mon, 28 Jun 2010 14:37:05 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: PR tree-optimization/44687 (partial inlining and nrv at i386) Message-ID: <20100628123705.GA6233@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list 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);