From patchwork Sat Jul 10 00:13:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 58445 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 752DBB6EEE for ; Sat, 10 Jul 2010 10:13:26 +1000 (EST) Received: (qmail 25655 invoked by alias); 10 Jul 2010 00:13:22 -0000 Received: (qmail 25645 invoked by uid 22791); 10 Jul 2010 00:13:20 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, 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; Sat, 10 Jul 2010 00:13:15 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 279AB9AC812; Sat, 10 Jul 2010 02:13:13 +0200 (CEST) Date: Sat, 10 Jul 2010 02:13:13 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix tramp3d -fprofile-generate compilation Message-ID: <20100710001313.GJ9621@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, while fixing DECL_BY_VALUE returning in inliner, I forgot to take care of non-ssa inlining. Bootstrapped/regtested x86_64-linux and comitted as obvious. Index: ChangeLog =================================================================== --- ChangeLog (revision 162023) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2010-07-09 Jan Hubicka + + * tree-inline.c (declare_return_variable): Fix ICE while + inlining DECL_BY_VALUE function not in SSA form + 2010-07-09 Changpeng Fang PR tree-optimization/44576 Index: tree-inline.c =================================================================== --- tree-inline.c (revision 161965) +++ tree-inline.c (working copy) @@ -2903,7 +2903,10 @@ declare_return_variable (copy_body_data add_referenced_var (temp); } insert_decl_map (id, result, temp); - temp = remap_ssa_name (gimple_default_def (id->src_cfun, result), id); + /* When RESULT_DECL is in SSA form, we need to use it's default_def + SSA_NAME. */ + if (gimple_in_ssa_p (id->src_cfun) && gimple_default_def (id->src_cfun, result)) + temp = remap_ssa_name (gimple_default_def (id->src_cfun, result), id); insert_init_stmt (id, entry_bb, gimple_build_assign (temp, var)); } else