]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcse.c (compute_pre_data): Kill trapping expressions in destination blocks of abnorma...
authorMichael Matz <matzmich@cs.tu-berlin.de>
Wed, 6 Dec 2000 18:45:31 +0000 (18:45 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 6 Dec 2000 18:45:31 +0000 (10:45 -0800)
        * gcse.c (compute_pre_data): Kill trapping expressions in
        destination blocks of abnormal edges.

From-SVN: r38068

gcc/ChangeLog
gcc/gcse.c

index 69b5ecccf41ad89a25ecdf5776ceed8f157675bf..3ea0e3b2ab7bfeae0be5d62887789808d8a9dc6a 100644 (file)
@@ -1,3 +1,8 @@
+2000-12-06  Michael Matz  <matzmich@cs.tu-berlin.de>
+
+       * gcse.c (compute_pre_data): Kill trapping expressions in
+       destination blocks of abnormal edges.
+
 2000-12-05  Richard Sandiford  <r.sandiford@redhat.com>
 
        * config/mn10300/mn10300.c (mn10300_print_reg_list): Added.
index 25736dfa67158aa0a6fe87380cb21239373aeb43..73f49f3ce88f8f19a910b88bf82121074f71ce73 100644 (file)
@@ -4157,11 +4157,24 @@ free_pre_mem ()
 static void
 compute_pre_data ()
 {
+  sbitmap trapping_expr;
   int i;
+  unsigned int ui;
 
   compute_local_properties (transp, comp, antloc, 0);
   sbitmap_vector_zero (ae_kill, n_basic_blocks);
 
+  /* Collect expressions which might trap.  */
+  trapping_expr = sbitmap_alloc (n_exprs);
+  sbitmap_zero (trapping_expr);
+  for (ui = 0; ui < expr_hash_table_size; ui++)
+    {
+      struct expr *e;
+      for (e = expr_hash_table[ui]; e != NULL; e = e->next_same_hash)
+       if (may_trap_p (e->expr))
+         SET_BIT (trapping_expr, e->bitmap_index);
+    }
+
   /* Compute ae_kill for each basic block using:
 
      ~(TRANSP | COMP)
@@ -4170,6 +4183,20 @@ compute_pre_data ()
 
   for (i = 0; i < n_basic_blocks; i++)
     {
+      edge e;
+
+      /* If the current block is the destination of an abnormal edge, we
+        kill all trapping expressions because we won't be able to properly
+        place the instruction on the edge.  So make them neither
+        anticipatable nor transparent.  This is fairly conservative.  */
+      for (e = BASIC_BLOCK (i)->pred; e ; e = e->pred_next)
+       if (e->flags & EDGE_ABNORMAL)
+         {
+           sbitmap_difference (antloc[i], antloc[i], trapping_expr);
+           sbitmap_difference (transp[i], transp[i], trapping_expr);
+           break;
+         }
+
       sbitmap_a_or_b (ae_kill[i], transp[i], comp[i]);
       sbitmap_not (ae_kill[i], ae_kill[i]);
     }
@@ -4180,6 +4207,7 @@ compute_pre_data ()
   antloc = NULL;
   free (ae_kill);
   ae_kill = NULL; 
+  free (trapping_expr);
 }
 \f
 /* PRE utilities */