From: Jim Wilson Date: Thu, 19 Oct 2000 23:21:14 +0000 (+0000) Subject: Fix ICE on lex output file reported by Andreas Schwab. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ef3751295c3062d9084ab72b681d53a911af2cc2;p=gcc.git Fix ICE on lex output file reported by Andreas Schwab. * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 793263b1f32..5fa663e4111 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2000-10-19 Jim Wilson + + * 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 * libgcc2.c (_mulvsi3): Change variables u and v to a and b. diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 52c1c7c464f..022161b8654 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -488,6 +488,9 @@ ;; 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")) diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index bf9db0dd788..e85cd200ce6 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -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;