Initialize INSN_COND (was: C6X port 5/11: Track predication conditions more accurately)

Alexander Monakov amonakov@ispras.ru
Thu Jun 2 11:30:00 GMT 2011


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  <amonakov@ispras.ru>

	* 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;
 




More information about the Gcc-patches mailing list