This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fw: conditional trap sched2 abort() on mainline


On Sun, 12 Oct 2003 00:59:19 -0700
Richard Henderson <rth@redhat.com> wrote:

> I don't see what traps have to do with this at all.  If we 
> changed *anything* then live data is not up to date.

Sure.

In this case, emitting the conditional trap instruction creates
an insn on the chain that needs a REG_DEAD note added to it.
Normally deletion of basic blocks will trigger ifcvt.c to update
the life info, but in this one case of conditional trap emission
we do not delete a basic block and therefore do not update life info.

Anyways, it seems to me that num_removed_blocks exists solely in
ifcvt.c just to keep track of whether we need to update life
information or not.  So maybe the better fix is to name this variable
more appropriately, and always increment it when we emit a conditional
trap instruction.

2003-10-13  David S. Miller  <davem@redhat.com>

	* ifcvt.c (num_removed_blocks): Rename to num_true_changes.
	(find_cond_trap): Always increment if we emit a conditional
	trap insn.
	
--- ifcvt.c.~1~	Wed Oct  8 10:08:51 2003
+++ ifcvt.c	Mon Oct 13 10:17:24 2003
@@ -75,8 +75,8 @@ static int num_possible_if_blocks;
    execution.  */
 static int num_updated_if_blocks;
 
-/* # of basic blocks that were removed.  */
-static int num_removed_blocks;
+/* # of changes made which require life information to be updated.  */
+static int num_true_changes;
 
 /* Whether conditional execution changes were made.  */
 static int cond_exec_changed_p;
@@ -2016,7 +2016,7 @@ merge_if_block (struct ce_if_block * ce_
 	  if (post_dominators)
 	    delete_from_dominance_info (post_dominators, bb);
 	  merge_blocks (combo_bb, bb);
-	  num_removed_blocks++;
+	  num_true_changes++;
 	}
       while (bb != last_test_bb);
     }
@@ -2033,7 +2033,7 @@ merge_if_block (struct ce_if_block * ce_
       if (post_dominators)
 	delete_from_dominance_info (post_dominators, then_bb);
       merge_blocks (combo_bb, then_bb);
-      num_removed_blocks++;
+      num_true_changes++;
     }
 
   /* The ELSE block, if it existed, had a label.  That label count
@@ -2044,7 +2044,7 @@ merge_if_block (struct ce_if_block * ce_
       if (post_dominators)
 	delete_from_dominance_info (post_dominators, else_bb);
       merge_blocks (combo_bb, else_bb);
-      num_removed_blocks++;
+      num_true_changes++;
     }
 
   /* If there was no join block reported, that means it was not adjacent
@@ -2101,7 +2101,7 @@ merge_if_block (struct ce_if_block * ce_
       if (post_dominators)
 	delete_from_dominance_info (post_dominators, join_bb);
       merge_blocks (combo_bb, join_bb);
-      num_removed_blocks++;
+      num_true_changes++;
     }
   else
     {
@@ -2544,6 +2544,8 @@ find_cond_trap (basic_block test_bb, edg
   if (seq == NULL)
     return FALSE;
 
+  num_true_changes++;
+
   /* Emit the new insns before cond_earliest.  */
   emit_insn_before_setloc (seq, cond_earliest, INSN_LOCATOR (trap));
 
@@ -2554,7 +2556,6 @@ find_cond_trap (basic_block test_bb, edg
       if (post_dominators)
 	delete_from_dominance_info (post_dominators, trap_bb);
       delete_block (trap_bb);
-      num_removed_blocks++;
     }
 
   /* If the non-trap block and the test are now adjacent, merge them.
@@ -2753,7 +2754,7 @@ find_if_case_1 (basic_block test_bb, edg
   /* We've possibly created jump to next insn, cleanup_cfg will solve that
      later.  */
 
-  num_removed_blocks++;
+  num_true_changes++;
   num_updated_if_blocks++;
 
   return TRUE;
@@ -2821,7 +2822,7 @@ find_if_case_2 (basic_block test_bb, edg
     delete_from_dominance_info (post_dominators, else_bb);
   delete_block (else_bb);
 
-  num_removed_blocks++;
+  num_true_changes++;
   num_updated_if_blocks++;
 
   /* ??? We may now fallthru from one of THEN's successors into a join
@@ -3112,7 +3113,7 @@ if_convert (int x_life_data_ok)
 
   num_possible_if_blocks = 0;
   num_updated_if_blocks = 0;
-  num_removed_blocks = 0;
+  num_true_changes = 0;
   life_data_ok = (x_life_data_ok != 0);
 
   if (! (* targetm.cannot_modify_jumps_p) ())
@@ -3173,7 +3174,7 @@ if_convert (int x_life_data_ok)
   clear_aux_for_blocks ();
 
   /* Rebuild life info for basic blocks that require it.  */
-  if (num_removed_blocks && life_data_ok)
+  if (num_true_changes && life_data_ok)
     {
       /* If we allocated new pseudos, we must resize the array for sched1.  */
       if (max_regno < max_reg_num ())
@@ -3196,8 +3197,8 @@ if_convert (int x_life_data_ok)
 	       "%d IF blocks converted.\n",
 	       num_updated_if_blocks);
       fprintf (rtl_dump_file,
-	       "%d basic blocks deleted.\n\n\n",
-	       num_removed_blocks);
+	       "%d true changes made.\n\n\n",
+	       num_true_changes);
     }
 
 #ifdef ENABLE_CHECKING


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]