From patchwork Wed Jun 30 16:41:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Matz X-Patchwork-Id: 57439 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 F33A1B6F06 for ; Thu, 1 Jul 2010 02:41:37 +1000 (EST) Received: (qmail 26852 invoked by alias); 30 Jun 2010 16:41:32 -0000 Received: (qmail 26834 invoked by uid 22791); 30 Jun 2010 16:41:29 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL, BAYES_00, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Jun 2010 16:41:24 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id B5F2186391; Wed, 30 Jun 2010 18:41:21 +0200 (CEST) Date: Wed, 30 Jun 2010 18:41:21 +0200 (CEST) From: Michael Matz To: Dominique Dhumieres Cc: gcc-patches@gcc.gnu.org, richard.guenther@gmail.com Subject: Re: [rfa] Fix PR44699: bootstrap problem In-Reply-To: <20100630162233.B2F063BE18@mailhost.lps.ens.fr> Message-ID: References: <20100630162233.B2F063BE18@mailhost.lps.ens.fr> MIME-Version: 1.0 X-IsSubscribed: yes 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, On Wed, 30 Jun 2010, Dominique Dhumieres wrote: > With the patches in > > http://gcc.gnu.org/ml/gcc-patches/2010-06/msg03011.html > http://gcc.gnu.org/ml/gcc-patches/2010-06/msg03122.html > > plus my fix for pr44726, I am now finishing to bootstrap > trunk at revision 161606 (currently building libjava). Okay, super. If you run the testsuite you'll probably notice a FAIL relating to "expecting ssa_name but got var_decl" or similar. I've fixed that in the checked in version (r161614 btw). FWIW, I've had to guard the assignment to SSA_NAME_DEF_STMT with a check for gimple_vdef(stmt) being an SSA_NAME, as we might get called on statements that aren't fully updated already. The final gimple-fold.c change I've checked in is below (the rest was as posted already). I'm going to cleanup that function somewhat later, as promised. Ciao, Michael. Index: gimple-fold.c =================================================================== --- gimple-fold.c (revision 161613) +++ gimple-fold.c (revision 161614) @@ -1133,7 +1133,8 @@ gimplify_and_update_call_from_tree (gimp if (gimple_vdef (stmt) && laststore) { gimple_set_vdef (laststore, gimple_vdef (stmt)); - move_ssa_defining_stmt_for_defs (laststore, stmt); + if (TREE_CODE (gimple_vdef (stmt)) == SSA_NAME) + SSA_NAME_DEF_STMT (gimple_vdef (stmt)) = laststore; update_stmt (laststore); } else @@ -1150,7 +1151,15 @@ gimplify_and_update_call_from_tree (gimp gsi_insert_before (si_p, last, GSI_NEW_STMT); gsi_next (si_p); } - if (laststore) + if (laststore && is_gimple_reg (lhs)) + { + gimple_set_vdef (laststore, gimple_vdef (stmt)); + update_stmt (laststore); + if (TREE_CODE (gimple_vdef (stmt)) == SSA_NAME) + SSA_NAME_DEF_STMT (gimple_vdef (stmt)) = laststore; + laststore = NULL; + } + else if (laststore) { reaching_vuse = make_ssa_name (gimple_vop (cfun), laststore); gimple_set_vdef (laststore, reaching_vuse); @@ -1158,9 +1167,14 @@ gimplify_and_update_call_from_tree (gimp laststore = NULL; } new_stmt = gimple_build_assign (lhs, tmp); - gimple_set_vuse (new_stmt, reaching_vuse); - gimple_set_vdef (new_stmt, gimple_vdef (stmt)); - move_ssa_defining_stmt_for_defs (new_stmt, stmt); + if (!is_gimple_reg (tmp)) + gimple_set_vuse (new_stmt, reaching_vuse); + if (!is_gimple_reg (lhs)) + { + gimple_set_vdef (new_stmt, gimple_vdef (stmt)); + if (TREE_CODE (gimple_vdef (stmt)) == SSA_NAME) + SSA_NAME_DEF_STMT (gimple_vdef (stmt)) = new_stmt; + } } gimple_set_location (new_stmt, gimple_location (stmt));