From patchwork Thu Jun 2 11:29:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Monakov X-Patchwork-Id: 98366 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 4D274B6F9C for ; Thu, 2 Jun 2011 21:30:10 +1000 (EST) Received: (qmail 731 invoked by alias); 2 Jun 2011 11:30:07 -0000 Received: (qmail 700 invoked by uid 22791); 2 Jun 2011 11:30:06 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL, BAYES_00, FSL_RU_URL, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.198.202) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Jun 2011 11:29:49 +0000 Received: from ispserv.ispras.ru (ispserv.ispras.ru [83.149.198.72]) by smtp.ispras.ru (Postfix) with ESMTP id EA29F5D40FD; Thu, 2 Jun 2011 15:25:22 +0400 (MSD) Received: from monoid.intra.ispras.ru (winnie.ispras.ru [83.149.198.236]) by ispserv.ispras.ru (Postfix) with ESMTP id 951733FC48; Thu, 2 Jun 2011 15:29:47 +0400 (MSD) Date: Thu, 2 Jun 2011 15:29:47 +0400 (MSD) From: Alexander Monakov To: Steve Ellcey cc: Andrey Belevantsev , Bernd Schmidt , GCC Patches Subject: Initialize INSN_COND (was: C6X port 5/11: Track predication conditions more accurately) In-Reply-To: <1306942802.2556.281.camel@hpsje.cup.hp.com> Message-ID: References: <201105311824.p4VIOf007288@lucas.cup.hp.com> <4DE5489F.4020005@hotbox.ru> <4DE5F5DF.7090407@ispras.ru> <1306942802.2556.281.camel@hpsje.cup.hp.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 Bernd, The problem is INSN_COND should be reset when initializing a new deps structure, otherwise instructions may get stale conditions from other previously analyzed instructions. Presuming that sd_init_insn is the proper place for that, I'll test the following patch. 2011-06-02 Alexander Monakov * sched-deps.c (sd_init_insn): Initialize INSN_COND. * sel-sched.c (move_op): Use correct type for 'res'. Verify that code_motion_path_driver returned 0 or 1. diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 343d03c..e50f7ab 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -737,6 +737,7 @@ sd_init_insn (rtx insn) INSN_RESOLVED_BACK_DEPS (insn) = create_deps_list (); INSN_FORW_DEPS (insn) = create_deps_list (); INSN_RESOLVED_FORW_DEPS (insn) = create_deps_list (); + INSN_COND (insn) = NULL_RTX; /* ??? It would be nice to allocate dependency caches here. */ } diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 3f22a3c..cb95f44 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -6675,7 +6675,7 @@ move_op (insn_t insn, av_set_t orig_ops, expr_t expr_vliw, { struct moveop_static_params sparams; struct cmpd_local_params lparams; - bool res; + int res; /* Init params for code_motion_path_driver. */ sparams.dest = dest; @@ -6694,6 +6694,8 @@ move_op (insn_t insn, av_set_t orig_ops, expr_t expr_vliw, code_motion_path_driver_info = &move_op_hooks; res = code_motion_path_driver (insn, orig_ops, NULL, &lparams, &sparams); + gcc_assert (res != -1); + if (sparams.was_renamed) EXPR_WAS_RENAMED (expr_vliw) = true;