Fix ICE on lex output file reported by Andreas Schwab.
authorJim Wilson <wilson@cygnus.com>
Thu, 19 Oct 2000 23:21:14 +0000 (23:21 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Thu, 19 Oct 2000 23:21:14 +0000 (16:21 -0700)
* haifa-sched.c (compute_trg_info): Add explanatory comments.
New local update_blocks.  Use update_blocks to remove duplicates
when computing update blocks.  Check for bblst_table overflow.
(schedule_block): Add explanatory comment.  Reduce bblst_size by
factor of 2.
* config/ia64/ia64.md (movdi_symbolic): Document loss of REG_LABEL
notes.

From-SVN: r36954

gcc/ChangeLog
gcc/config/ia64/ia64.md
gcc/haifa-sched.c

index 793263b1f32eb0e2e6897a9e18f1156c6142dc04..5fa663e4111376f6406e39641220229021e08c0d 100644 (file)
@@ -1,3 +1,13 @@
+2000-10-19  Jim Wilson  <wilson@cygnus.com>
+
+       * haifa-sched.c (compute_trg_info): Add explanatory comments.
+       New local update_blocks.  Use update_blocks to remove duplicates
+       when computing update blocks.  Check for bblst_table overflow.
+       (schedule_block): Add explanatory comment.  Reduce bblst_size by
+       factor of 2.
+       * config/ia64/ia64.md (movdi_symbolic): Document loss of REG_LABEL
+       notes.
+       
 2000-10-19  Chandrakala Chavva   <cchavva@redhat.com>
 
        * libgcc2.c (_mulvsi3): Change variables u and v to a and b.
index 52c1c7c464f8c9102c6de90ebdf565eba552638c..022161b8654185a5e7165ad69f159588320a0f3d 100644 (file)
 ;; deferred functions, since we may acquire additional information
 ;; on the variables used in the meantime.
 
+;; ??? This causes us to lose REG_LABEL notes, because the insn splitter
+;; does not attempt to preserve any REG_NOTES on the input instruction.
+
 (define_insn_and_split "movdi_symbolic"
   [(set (match_operand:DI 0 "register_operand" "=r")
        (match_operand:DI 1 "symbolic_operand" "s"))
index bf9db0dd7881e2d7f74fb9d153a4ac51b3488e13..e85cd200ce6e4eedf63e0595a869fd1f96a1a679 100644 (file)
@@ -2036,12 +2036,26 @@ compute_trg_info (trg)
 
       if (sp->is_valid)
        {
+         char *update_blocks;
+
+         /* Compute split blocks and store them in bblst_table.
+            The TO block of every split edge is a split block.  */
          sp->split_bbs.first_member = &bblst_table[bblst_last];
          sp->split_bbs.nr_members = el.nr_members;
          for (j = 0; j < el.nr_members; bblst_last++, j++)
            bblst_table[bblst_last] =
              TO_BLOCK (rgn_edges[el.first_member[j]]);
          sp->update_bbs.first_member = &bblst_table[bblst_last];
+
+         /* Compute update blocks and store them in bblst_table.
+            For every split edge, look at the FROM block, and check
+            all out edges.  For each out edge that is not a split edge,
+            add the TO block to the update block list.  This list can end
+            up with a lot of duplicates.  We need to weed them out to avoid
+            overrunning the end of the bblst_table.  */
+         update_blocks = (char *) alloca (n_basic_blocks);
+         bzero (update_blocks, n_basic_blocks);
+
          update_idx = 0;
          for (j = 0; j < el.nr_members; j++)
            {
@@ -2049,14 +2063,18 @@ compute_trg_info (trg)
              fst_edge = nxt_edge = OUT_EDGES (check_block);
              do
                {
-                 for (k = 0; k < el.nr_members; k++)
-                   if (EDGE_TO_BIT (nxt_edge) == el.first_member[k])
-                     break;
-
-                 if (k >= el.nr_members)
+                 if (! update_blocks[TO_BLOCK (nxt_edge)])
                    {
-                     bblst_table[bblst_last++] = TO_BLOCK (nxt_edge);
-                     update_idx++;
+                     for (k = 0; k < el.nr_members; k++)
+                       if (EDGE_TO_BIT (nxt_edge) == el.first_member[k])
+                         break;
+
+                     if (k >= el.nr_members)
+                       {
+                         bblst_table[bblst_last++] = TO_BLOCK (nxt_edge);
+                         update_blocks[TO_BLOCK (nxt_edge)] = 1;
+                         update_idx++;
+                       }
                    }
 
                  nxt_edge = NEXT_OUT (nxt_edge);
@@ -2065,6 +2083,9 @@ compute_trg_info (trg)
            }
          sp->update_bbs.nr_members = update_idx;
 
+         /* Make sure we didn't overrun the end of bblst_table.  */
+         if (bblst_last > bblst_size)
+           abort ();
        }
       else
        {
@@ -5903,12 +5924,11 @@ schedule_block (bb, rgn_n_insns)
                                               * sizeof (candidate));
 
       bblst_last = 0;
-      /* ??? It is not clear why bblst_size is computed this way.  The original
-        number was clearly too small as it resulted in compiler failures.
-        Multiplying by the original number by 2 (to account for update_bbs
-        members) seems to be a reasonable solution.  */
-      /* ??? Or perhaps there is a bug somewhere else in this file?  */
-      bblst_size = (current_nr_blocks - bb) * rgn_nr_edges * 2;
+      /* bblst_table holds split blocks and update blocks for each block after
+        the current one in the region.  split blocks and update blocks are
+        the TO blocks of region edges, so there can be at most rgn_nr_edges
+        of them.  */
+      bblst_size = (current_nr_blocks - bb) * rgn_nr_edges;
       bblst_table = (int *) xmalloc (bblst_size * sizeof (int));
 
       bitlst_table_last = 0;