[Bug rtl-optimization/45352] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7058
--- Comment #4 from abel at gcc dot gnu dot org 2010-09-22 14:29 --- Confirmed. All testcases except the first with the -O3 flags are fixed by the below patch. The bug that the patch fixes is actually PR37360 all over again but in sel-sched instead of haifa. We have the process of resetting sched-cycles for insns (that may be wrong because of pipelining) for the targets that may use them in their sched_finish hook. (E.g. ia64 does bundling in this hook.) The process is just scheduling insns in the same order as they are already, calling all the necessary hooks and massaging DFA so we get the correct cycles from it. The assert triggered means that the selective scheduling and this resetting process got out of sync. And this happened guess why, because (for the last test I had actually analyzed) the target claims issue_rate of 3 while issuing 4 insns on the same cycle! I'm actually surprised that the GCC target lying to the backend may still surprise me, but I guess ten more years of GCC work would do the trick. I will be looking at the remaining failure shortly. diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 041c471..aff7eae 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -4402,7 +4402,8 @@ find_best_expr (av_set_t *av_vliw_ptr, blist_t bnds, fence_t fence, { can_issue_more = invoke_aftermath_hooks (fence, EXPR_INSN_RTX (best), can_issue_more); - if (can_issue_more == 0) + if (targetm.sched.variable_issue + can_issue_more == 0) *pneed_stall = 1; } -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2010-09-22 14:29:22 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45352
[Bug rtl-optimization/45352] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7058
--- Comment #5 from abel at gcc dot gnu dot org 2010-09-22 15:34 --- The remaining problem is another case where we don't try to issue more insns because we believe from issue_rate that this is impossible. Full patch that fixes all the tests with all the flags for me is below. What it does is to fix the situation when we don't try to issue an insn not because some target hook said so, but because we believe that issue_rate is achieved already. In this case, we still try. There is some related debug dump improvements in the patch. The patch will need a round of testing on a number of arches to check that I didn't broke the honest targets and a big comment explaining why we do this before I will submit to gcc-patches. diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 041c471..aee298a 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -4051,10 +4051,11 @@ sel_dfa_new_cycle (insn_t insn, fence_t fence) /* Invoke reorder* target hooks on the ready list. Return the number of insns we can issue. FENCE is the current fence. */ static int -invoke_reorder_hooks (fence_t fence) +invoke_reorder_hooks (fence_t fence, bool *pran_hook) { int issue_more; - bool ran_hook = false; + + *pran_hook = false; /* Call the reorder hook at the beginning of the cycle, and call the reorder2 hook in the middle of the cycle. */ @@ -4077,7 +4078,7 @@ invoke_reorder_hooks (fence_t fence) if (pipelining_p) ++ready.n_ready; - ran_hook = true; + *pran_hook = true; } else /* Initialize can_issue_more for variable_issue. */ @@ -4106,14 +4107,14 @@ invoke_reorder_hooks (fence_t fence) ++ready.n_ready; } - ran_hook = true; + *pran_hook = true; } else issue_more = FENCE_ISSUE_MORE (fence); /* Ensure that ready list and vec_av_set are in line with each other, i.e. vec_av_set[i] == ready_element (ready, i). */ - if (issue_more ran_hook) + if (issue_more *pran_hook) { int i, j, n; rtx *arr = ready.vec; @@ -4313,7 +4314,7 @@ get_expr_cost (expr_t expr, fence_t fence) /* Find the best insn for scheduling, either via max_issue or just take the most prioritized available. */ static int -choose_best_insn (fence_t fence, int privileged_n, int *index) +choose_best_insn (fence_t fence, int privileged_n, bool ran_hook, int *index) { int can_issue = 0; @@ -4338,6 +4339,8 @@ choose_best_insn (fence_t fence, int privileged_n, int *index) if (get_expr_cost (expr, fence) 1) { can_issue = can_issue_more; + if (!ran_hook !can_issue) + can_issue = 1; *index = i; if (sched_verbose = 2) @@ -4366,6 +4369,7 @@ find_best_expr (av_set_t *av_vliw_ptr, blist_t bnds, fence_t fence, int *pneed_stall) { expr_t best; + bool ran_hook; /* Choose the best insn for scheduling via: 1) sorting the ready list based on priority; @@ -4376,8 +4380,8 @@ find_best_expr (av_set_t *av_vliw_ptr, blist_t bnds, fence_t fence, { int privileged_n, index; - can_issue_more = invoke_reorder_hooks (fence); - if (can_issue_more 0) + can_issue_more = invoke_reorder_hooks (fence, ran_hook); + if (can_issue_more 0 || !ran_hook) { /* Try choosing the best insn until we find one that is could be scheduled due to liveness restrictions on its destination register. @@ -4385,7 +4389,7 @@ find_best_expr (av_set_t *av_vliw_ptr, blist_t bnds, fence_t fence, in the order of their priority. */ invoke_dfa_lookahead_guard (); privileged_n = calculate_privileged_insns (); - can_issue_more = choose_best_insn (fence, privileged_n, index); + can_issue_more = choose_best_insn (fence, privileged_n, ran_hook, index); if (can_issue_more) best = find_expr_for_ready (index, true); } @@ -4402,7 +4406,8 @@ find_best_expr (av_set_t *av_vliw_ptr, blist_t bnds, fence_t fence, { can_issue_more = invoke_aftermath_hooks (fence, EXPR_INSN_RTX (best), can_issue_more); - if (can_issue_more == 0) + if (targetm.sched.variable_issue + can_issue_more == 0) *pneed_stall = 1; } @@ -7046,6 +7051,8 @@ reset_sched_cycles_in_current_ebb (void) } haifa_clock += i; + if (sched_verbose = 2) +sel_print (haifa clock: %d\n, haifa_clock); } else gcc_assert (haifa_cost == 0); @@ -7064,6 +7071,7 @@ reset_sched_cycles_in_current_ebb (void) { sel_print (advance_state (dfa_new_cycle)\n); debug_state (curr_state); + sel_print (haifa clock: %d\n, haifa_clock + 1); } } @@ -7072,8 +7080,11 @@ reset_sched_cycles_in_current_ebb
[Bug rtl-optimization/45570] [4.6 Regression] ICE: in cfg_preds_1, at sel-sched-ir.c:4584
--- Comment #2 from abel at gcc dot gnu dot org 2010-09-22 15:57 --- Neither of these option combinations fail for me on x86-64 with a recent trunk (164506). We will investigate further with the given trunk revisions. -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45570
[Bug rtl-optimization/45472] [4.5/4.6 Regression] ICE: in move_op_ascend, at sel-sched.c:6124 with -fselective-scheduling2
--- Comment #3 from abel at gcc dot gnu dot org 2010-09-20 13:05 --- We have the code like this: if (...) { 17 cx:DI=[`s2'] //comes from s2.vl += s1.vl; ... } 27 dx:DI=[`s2'] //comes from s1 = s2; When the scheduler tries to move insn 27 before if (...), it also unifies its right-hand sides, as they seem equal. The scheduler wants to get: 27 dx:DI=[`s2'] if (...) { cx = dx ... dx:DI=[`s2'] // bookkeeping } The insn 17 has its MEM with volatile bit set, the insn 27 has it unset. It so happens that when gathering the available insn set and when moving the actually selected insn, insns 17 and 27 got merged in the different order. First we don't have the volatile bit on the resulting insn, thus we believe the load does not trap and we move it up through a jump before the 'if'. Second we have the bit and thus insn traps and we don't move it, then we hit the consistency assert in the scheduler. Now, I'm happy to implement the correct merging of the may_trap_p bit in the scheduler which would fix this. However, looking at the original C code it looks like both MEMs should have their volatile bit set. I can only say that the original bits seem to come from expand, the addresses got propagated by fwprop but this doesn't seem to be the issue. -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45472
[Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
--- Comment #6 from abel at gcc dot gnu dot org 2010-08-24 08:51 --- Subject: Bug 40101 Author: abel Date: Tue Aug 24 08:50:50 2010 New Revision: 163498 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163498 Log: Backport from mainline: PR rtl-optimization/40101 * sel-sched-ir.c (get_seqno_by_preds): Allow returning negative seqno. Adjust comment. * sel-sched.c (find_seqno_for_bookkeeping): Assert that when inserting bookkeeping before a jump, the jump is not scheduled. When no positive seqno found, provide a value. Add comment. Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched-ir.c branches/gcc-4_4-branch/gcc/sel-sched.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101
[Bug rtl-optimization/41697] ICE on gcc.c-torture/compile/20090917-1.c
--- Comment #4 from abel at gcc dot gnu dot org 2010-08-24 08:52 --- Subject: Bug 41697 Author: abel Date: Tue Aug 24 08:51:56 2010 New Revision: 163499 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163499 Log: Backport from mainline: 2009-10-15 Steve Ellcey s...@cup.hp.com PR rtl-optimization/41697 * sel-sched-ir.h (_eligible_successor_edge_p): Check successor count. Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched-ir.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41697
[Bug rtl-optimization/41697] ICE on gcc.c-torture/compile/20090917-1.c
--- Comment #5 from abel at gcc dot gnu dot org 2010-08-24 08:54 --- Subject: Bug 41697 Author: abel Date: Tue Aug 24 08:54:02 2010 New Revision: 163502 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163502 Log: Backport from mainline: PR rtl-optimization/41697 * sel-sched-ir.c (fallthru_bb_of_jump): Bail out when a block with a conditional jump has a single successor. Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched-ir.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41697
[Bug rtl-optimization/42294] [4.5 Regression] ICE in code_motion_path_driver for 416.gamess
--- Comment #12 from abel at gcc dot gnu dot org 2010-08-24 08:55 --- Subject: Bug 42294 Author: abel Date: Tue Aug 24 08:55:33 2010 New Revision: 163503 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163503 Log: Backport from mainline: PR rtl-optimization/42294 * sel-sched.c (try_replace_dest_reg): When chosen register and original register is the same, do not bail out early, but still check all original insns for validity of replacing destination register. Set EXPR_TARGET_AVAILABLE to 1 before leaving function in this case. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42249.c Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42294
[Bug middle-end/42245] ICE in verify_backedges for 197.parser with sel-sched
--- Comment #12 from abel at gcc dot gnu dot org 2010-08-24 08:57 --- Subject: Bug 42245 Author: abel Date: Tue Aug 24 08:57:18 2010 New Revision: 163504 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163504 Log: Backport from mainline: 2010-01-14 Andrey Belevantsev a...@ispras.ru Alexander Monakov amona...@ispras.ru PR middle-end/42245 * sel-sched-ir.c (sel_recompute_toporder): New. Use it... (maybe_tidy_empty_bb): ... here. Make static. Add new argument. Update all callers. (tidy_control_flow): ... and here. Recompute topological order of basic blocks in region if necessary. (sel_redirect_edge_and_branch): Change return type. Return true if topological order might have been invalidated. (purge_empty_blocks): Export and move from... * sel-sched.c (purge_empty_blocks): ... here. * sel-sched-ir.h (sel_redirect_edge_and_branch): Update prototype. (maybe_tidy_empty_bb): Delete prototype. (purge_empty_blocks): Declare. Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched-ir.c branches/gcc-4_4-branch/gcc/sel-sched-ir.h branches/gcc-4_4-branch/gcc/sel-sched.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42245
[Bug rtl-optimization/39453] ICE : in init_seqno, at sel-sched.c:6433
--- Comment #8 from abel at gcc dot gnu dot org 2010-08-24 08:58 --- Subject: Bug 39453 Author: abel Date: Tue Aug 24 08:58:36 2010 New Revision: 163505 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163505 Log: Backport from mainline: 2010-01-14 Alexander Monakov amona...@ispras.ru PR rtl-optimization/39453 PR rtl-optimization/42246 * sel-sched-ir.c (considered_for_pipelining_p): Do not test for pipelining_p. (sel_add_loop_preheaders): Add preheader to last_added_blocks. * gcc.dg/pr39453.c: New. * gcc.dg/pr42246.c: New. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr39453.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42246.c Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched-ir.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39453
[Bug rtl-optimization/42246] ICE in init_seqno for 186.crafty with sel-sched
--- Comment #8 from abel at gcc dot gnu dot org 2010-08-24 08:58 --- Subject: Bug 42246 Author: abel Date: Tue Aug 24 08:58:36 2010 New Revision: 163505 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163505 Log: Backport from mainline: 2010-01-14 Alexander Monakov amona...@ispras.ru PR rtl-optimization/39453 PR rtl-optimization/42246 * sel-sched-ir.c (considered_for_pipelining_p): Do not test for pipelining_p. (sel_add_loop_preheaders): Add preheader to last_added_blocks. * gcc.dg/pr39453.c: New. * gcc.dg/pr42246.c: New. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr39453.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42246.c Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched-ir.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42246
[Bug rtl-optimization/42294] [4.5 Regression] ICE in code_motion_path_driver for 416.gamess
--- Comment #13 from abel at gcc dot gnu dot org 2010-08-24 09:00 --- Subject: Bug 42294 Author: abel Date: Tue Aug 24 08:59:47 2010 New Revision: 163506 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163506 Log: Backport from mainline: 2010-01-14 Alexander Monakov amona...@ispras.ru PR rtl-optimization/42294 * sel-sched-ir.h (struct _sel_insn_data): Update comment. * sel-sched.c (move_exprs_to_boundary): Transitively add all originators' originators. Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched-ir.h branches/gcc-4_4-branch/gcc/sel-sched.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42294
[Bug rtl-optimization/42388] [4.5 Regression] ICE in move_bb_info with sel-sched and modulo-sched for 176.gcc
--- Comment #7 from abel at gcc dot gnu dot org 2010-08-24 09:01 --- Subject: Bug 42388 Author: abel Date: Tue Aug 24 09:01:18 2010 New Revision: 163507 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163507 Log: Backport from mainline: PR rtl-optimization/42388 * sel-sched-ir.c (maybe_tidy_empty_bb): Do not delete empty blocks that have no predecessors nor successors. Do not call move_bb_info for empty blocks outside of current region. Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched-ir.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42388
[Bug rtl-optimization/42389] ICE in advance_state_on_fence with sel-schd for 175.vpr
--- Comment #5 from abel at gcc dot gnu dot org 2010-08-24 09:02 --- Subject: Bug 42389 Author: abel Date: Tue Aug 24 09:02:30 2010 New Revision: 163508 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163508 Log: Backport from mainline: PR rtl-optimization/42389 * sel-sched.c (advance_one_cycle): Set FENCE_ISSUE_MORE to can_issue_more. (advance_state_on_fence): Likewise. (sel_target_adjust_priority): Print debug output only when sched_verbose = 4, not 2. (get_expr_cost): Do not issue all unique insns on the next cycle. (fill_insns): Initialize can_issue_more from the value saved with the fence. * sel-sched-ir.c (flist_add): New parameter issue_more. Init FENCE_ISSUE_MORE with it. (merge_fences): Likewise. (init_fences): Update call to flist_add. (add_to_fences, add_clean_fence_to_fences) (add_dirty_fence_to_fences): Likewise. (move_fence_to_fences): Update call to merge_fences. (invoke_reorder_hooks): Do not reset can_issue_more on insns from sched groups. * sel-sched-ir.h (struct _fence): New field issue_more. (FENCE_ISSUE_MORE): New accessor macro. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42389.c Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched-ir.c branches/gcc-4_4-branch/gcc/sel-sched-ir.h branches/gcc-4_4-branch/gcc/sel-sched.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42389
[Bug rtl-optimization/42246] ICE in init_seqno for 186.crafty with sel-sched
--- Comment #9 from abel at gcc dot gnu dot org 2010-08-24 09:08 --- Subject: Bug 42246 Author: abel Date: Tue Aug 24 09:08:23 2010 New Revision: 163513 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163513 Log: Backport from mainline: PR rtl-optimization/42246 * sel-sched-ir.h (get_all_loop_exits): Include exits from inner loops. Added: branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/pr42246-2.f Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched-ir.h branches/gcc-4_4-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42246
[Bug rtl-optimization/44691] [4.6 Regression] ICE: RTL check: expected code 'reg', have 'plus' in rhs_regno, at rtl.h:1050
--- Comment #7 from abel at gcc dot gnu dot org 2010-08-24 09:12 --- Subject: Bug 44691 Author: abel Date: Tue Aug 24 09:11:48 2010 New Revision: 163516 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163516 Log: Backport from mainline: PR rtl-optimization/44691 * sel-sched.c (count_occurrences_1): Also punt when SUBREG_REG is not a register. * gfortran.dg/pr44691.f: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/pr44691.f Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/sel-sched.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44691
[Bug rtl-optimization/44691] [4.6 Regression] ICE: RTL check: expected code 'reg', have 'plus' in rhs_regno, at rtl.h:1050
--- Comment #6 from abel at gcc dot gnu dot org 2010-08-20 08:07 --- Subject: Bug 44691 Author: abel Date: Fri Aug 20 08:07:17 2010 New Revision: 163396 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163396 Log: PR rtl-optimization/44691 * gfortran.dg/pr44691.f: New test. Added: trunk/gcc/testsuite/gfortran.dg/pr44691.f Modified: trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44691
[Bug rtl-optimization/44691] [4.6 Regression] ICE: RTL check: expected code 'reg', have 'plus' in rhs_regno, at rtl.h:1050
--- Comment #4 from abel at gcc dot gnu dot org 2010-08-19 10:04 --- Subject: Bug 44691 Author: abel Date: Thu Aug 19 10:03:39 2010 New Revision: 163369 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163369 Log: PR rtl-optimization/44691 * sel-sched.c (count_occurrences_1): Also punt when SUBREG_REG is not a register. Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44691
[Bug rtl-optimization/44691] [4.6 Regression] ICE: RTL check: expected code 'reg', have 'plus' in rhs_regno, at rtl.h:1050
--- Comment #5 from abel at gcc dot gnu dot org 2010-08-19 10:04 --- Fixed by 163369. -- abel at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44691
[Bug target/44919] ICE on ia64 with -O3 at sel-sched.c:4672
--- Comment #6 from abel at gcc dot gnu dot org 2010-08-04 13:17 --- My employer's copyright assignment has expired, this would be fixed within a week or so. Never mind because there's still time before the next 4.4 release. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44919
[Bug target/44919] ICE on ia64 with -O3 at sel-sched.c:4672
--- Comment #2 from abel at gcc dot gnu dot org 2010-07-13 14:07 --- Confirmed on the 4.4 branch. The problem is latent on trunk. When we have added support for moving insns through mutually exclusive insns, it was made possible to move conditional jumps across block boundaries. But we didn't fix move_cond_jump accordingly, as it assumes that the jump can be moved only through insns in the same block. Fixed by the below patch that seems to work on the test case. Could you check whether it works for your full program? -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org, ||amonakov at gcc dot gnu dot ||org AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2010-07-13 14:07:55 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44919
[Bug target/44919] ICE on ia64 with -O3 at sel-sched.c:4672
--- Comment #3 from abel at gcc dot gnu dot org 2010-07-13 14:10 --- Created an attachment (id=21190) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21190action=view) proposed patch This exact patch is against trunk, it may apply with fuzz on 4_4 branch. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44919
[Bug target/43603] gcc-4.4.3 ICE on ia64 with -O3
--- Comment #5 from abel at gcc dot gnu dot org 2010-06-30 08:44 --- The below patch implements keeping dominance info up to date in the scheduler. After discussions with Alexander, I think that it will be better to leave the copy_rtx calls as is, so that if we'll see this problem once again, we fail immediately instead of silently miscompiling code. The patch fixes both this testcase and PR 44233's testcase. (Also, Zdenek kindly provided a patch for the dominator tree infrastructure that eases the development by failing immediately when the dominator data structures become inconsistent, and I've made a cleanup patch in the scheduler. I will also submit both of those patches.) gcc/haifa-sched.c |2 + gcc/sel-sched-ir.c | 53 +++ 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 8d7149f..6bf526e 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -4452,6 +4452,8 @@ sched_create_recovery_edges (basic_block first_bb, basic_block rec, edge_flags = 0; make_single_succ_edge (rec, second_bb, edge_flags); + if (dom_info_available_p (CDI_DOMINATORS)) +set_immediate_dominator (CDI_DOMINATORS, rec, first_bb); } /* This function creates recovery code for INSN. If MUTATE_P is nonzero, diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 3146a26..f2be2df 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -3544,6 +3544,7 @@ static bool maybe_tidy_empty_bb (basic_block bb, bool recompute_toporder_p) { basic_block succ_bb, pred_bb; + VEC (basic_block, heap) *dom_bbs; edge e; edge_iterator ei; bool rescan_p; @@ -3579,6 +3580,7 @@ maybe_tidy_empty_bb (basic_block bb, bool recompute_toporder_p) succ_bb = single_succ (bb); rescan_p = true; pred_bb = NULL; + dom_bbs = NULL; /* Redirect all non-fallthru edges to the next bb. */ while (rescan_p) @@ -3591,6 +3593,12 @@ maybe_tidy_empty_bb (basic_block bb, bool recompute_toporder_p) if (!(e-flags EDGE_FALLTHRU)) { + /* We will update dominators here only when we'll get + an unreachable block when redirecting, otherwise + sel_redirect_edge_and_branch will take care of it. */ + if (e-dest != bb + single_pred_p (e-dest)) +VEC_safe_push (basic_block, heap, dom_bbs, e-dest); recompute_toporder_p |= sel_redirect_edge_and_branch (e, succ_bb); rescan_p = true; break; @@ -3610,11 +3618,20 @@ maybe_tidy_empty_bb (basic_block bb, bool recompute_toporder_p) remove_empty_bb (bb, true); } + + if (!VEC_empty (basic_block, dom_bbs)) +{ + VEC_safe_push (basic_block, heap, dom_bbs, succ_bb); + iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, false); + VEC_free (basic_block, heap, dom_bbs); +} + if (recompute_toporder_p) sel_recompute_toporder (); #ifdef ENABLE_CHECKING verify_backedges (); + verify_dominators (CDI_DOMINATORS); #endif return true; @@ -5026,7 +5043,12 @@ sel_remove_bb (basic_block bb, bool remove_from_cfg_p) bitmap_clear_bit (blocks_to_reschedule, idx); if (remove_from_cfg_p) -delete_and_free_basic_block (bb); +{ + basic_block succ = single_succ (bb); + delete_and_free_basic_block (bb); + set_immediate_dominator (CDI_DOMINATORS, succ, + recompute_dominator (CDI_DOMINATORS, succ)); +} rgn_setup_region (CONTAINING_RGN (idx)); } @@ -5361,12 +5383,15 @@ sel_merge_blocks (basic_block a, basic_block b) void sel_redirect_edge_and_branch_force (edge e, basic_block to) { - basic_block jump_bb, src; + basic_block jump_bb, src, orig_dest = e-dest; int prev_max_uid; rtx jump; - gcc_assert (!sel_bb_empty_p (e-src)); - + /* This function is now used only for bookkeeping code creation, where + we'll never get the single pred of orig_dest block and thus will not + hit unreachable blocks when updating dominator info. */ + gcc_assert (!sel_bb_empty_p (e-src) + !single_pred_p (orig_dest)); src = e-src; prev_max_uid = get_max_uid (); jump_bb = redirect_edge_and_branch_force (e, to); @@ -5383,6 +5408,10 @@ sel_redirect_edge_and_branch_force (edge e, basic_block to) jump = find_new_jump (src, jump_bb, prev_max_uid); if (jump) sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP); + set_immediate_dominator (CDI_DOMINATORS, orig_dest, + recompute_dominator (CDI_DOMINATORS, orig_dest)); + set_immediate_dominator (CDI_DOMINATORS, to, + recompute_dominator (CDI_DOMINATORS, to)); } /* A wrapper for redirect_edge_and_branch. Return TRUE if blocks connected by @@ -5391,11 +5420,12 @@ bool sel_redirect_edge_and_branch (edge e, basic_block to) { bool latch_edge_p; - basic_block src
[Bug rtl-optimization/44691] [4.6 Regression] ICE: RTL check: expected code 'reg', have 'plus' in rhs_regno, at rtl.h:1050
--- Comment #2 from abel at gcc dot gnu dot org 2010-06-30 08:49 --- The below patch fixes the problem for me. diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 8590b8a..15c4e51 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -837,7 +837,8 @@ count_occurrences_1 (rtx *cur_rtx, void *arg) if (GET_CODE (*cur_rtx) == SUBREG REG_P (p-x) - REGNO (SUBREG_REG (*cur_rtx)) == REGNO (p-x)) + (!REG_P (SUBREG_REG (*cur_rtx)) + || REGNO (SUBREG_REG (*cur_rtx)) == REGNO (p-x))) { /* ??? Do not support substituting regs inside subregs. In that case, simplify_subreg will be called by validate_replace_rtx, and -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44691
[Bug rtl-optimization/44691] [4.6 Regression] ICE: RTL check: expected code 'reg', have 'plus' in rhs_regno, at rtl.h:1050
--- Comment #1 from abel at gcc dot gnu dot org 2010-06-28 15:07 --- Confirmed. This is because we see an insn (set (reg:SI 1 dx [237]) (subreg:SI (plus:DI (reg:DI 2 cx [orig:135 imaj ] [135]) (const_int -1 [0x])) 0)) generated by the recently added split for lea. I thought the scheduler would see only a reg as the first operand of a subreg, thus we hit an ICE when we assume that SUBREG_REG is actually a REG. This however seems to be legal as several backends use fancy subreg expressions. I will recheck and then will fix this. -- abel at gcc dot gnu dot org changed: What|Removed |Added CC|abel at ispras dot ru |abel at gcc dot gnu dot org AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2010-06-28 15:07:28 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44691
[Bug target/43603] gcc-4.4.3 ICE on ia64 with -O3
--- Comment #3 from abel at gcc dot gnu dot org 2010-04-20 08:36 --- The problem is in the remove_insns_that_need_bookkeeping function, which should filter out all instructions that cannot be copied but yet may require bookkeeping. An instruction with asm operands is an example of those insns. In the function, we use dominated_by_p to check that the target block dominates the source block of the instruction, but the answer we get is wrong as the dominance information is broken at this point, and that is because we do not maintain it. We need to devise a patch to update the dominance information in the scheduler using the dominator infrastructure or to stop using it altogether and to rewrite the function in question. The former requires some effort as my first attempt at this failed, the latter will likely lead to performance regressions. I will work further on keeping dominance info up to date. However, the resulting patch will probably be unsuitable for a release branch. That said, the copy_rtx calls should be fixed nevertheless, but currently it should not matter for the instructions we really want to clone. That may change of course. -- abel at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|NEW |ASSIGNED Last reconfirmed|2010-04-04 01:34:03 |2010-04-20 08:36:09 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43603
[Bug middle-end/42859] [4.5 regression] ICE in verify_flow_info
--- Comment #10 from abel at gcc dot gnu dot org 2010-03-10 11:09 --- Subject: Bug 42859 Author: abel Date: Wed Mar 10 11:08:48 2010 New Revision: 157337 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=157337 Log: PR middle-end/42859 * tree-eh.c: Include pointer-set.h. (lower_eh_dispatch): Filter out duplicate case labels and remove the unneeded edge when the label is unused. Return true when some edges are removed. (execute_lower_eh_dispatch): When any lowering resulted in removing an edge, also delete unreachable blocks. * g++.dg/eh/pr42859.C: New test. Added: trunk/gcc/testsuite/g++.dg/eh/pr42859.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-eh.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42859
[Bug middle-end/42859] [4.5 regression] ICE in verify_flow_info
--- Comment #11 from abel at gcc dot gnu dot org 2010-03-10 11:09 --- Fixed. -- abel at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42859
[Bug middle-end/42859] [4.5 regression] ICE in verify_flow_info
--- Comment #9 from abel at gcc dot gnu dot org 2010-02-24 15:58 --- Created an attachment (id=19949) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19949action=view) patch Here is the updated patch, it bootstraps and regtests fine on x86-64 linux. I'm leaving for about a week starting tomorrow, so no post to gcc-patches now, sorry. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42859
[Bug middle-end/42859] [4.5 regression] ICE in verify_flow_info
--- Comment #8 from abel at gcc dot gnu dot org 2010-02-22 20:10 --- (In reply to comment #7) Looks sensible, though unreachable block removal should be conditional on us removing an edge, not on lowering anything. Sure, I'd just make lower_eh_dispatch return a boolean for this and repost to gcc-patches. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42859
[Bug middle-end/42859] [4.5 regression] ICE in verify_flow_info
--- Comment #6 from abel at gcc dot gnu dot org 2010-02-16 15:43 --- How about the below patch? It fixes all testcases for me. I'm not sure whether it makes sense to filter duplicate labels this late, but I don't know how to do this earlier, as catches seem to be lowering independently of each other. diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 2cb334f..c18b807 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see #include flags.h #include function.h #include except.h +#include pointer-set.h #include tree-flow.h #include tree-dump.h #include tree-inline.h @@ -3063,6 +3064,7 @@ lower_eh_dispatch (basic_block src, gimple stmt) eh_catch c; edge_iterator ei; edge e; + struct pointer_set_t *seen_values = pointer_set_create (); /* Collect the labels for a switch. Zero the post_landing_pad field becase we'll no longer have anything keeping these labels @@ -3071,6 +3073,7 @@ lower_eh_dispatch (basic_block src, gimple stmt) for (c = r-u.eh_try.first_catch; c ; c = c-next_catch) { tree tp_node, flt_node, lab = c-label; + bool have_label = false; c-label = NULL; tp_node = c-type_list; @@ -3083,14 +3086,26 @@ lower_eh_dispatch (basic_block src, gimple stmt) } do { - tree t = build3 (CASE_LABEL_EXPR, void_type_node, -TREE_VALUE (flt_node), NULL, lab); - VEC_safe_push (tree, heap, labels, t); + /* Filter out duplicate labels that arise when this handler + is shadowed by an earlier one. When no labels are + attached to the handler anymore, we remove + the corresponding edge and then we delete unreachable + blocks at the end of this pass. */ + if (! pointer_set_contains (seen_values, TREE_VALUE (flt_node))) + { + tree t = build3 (CASE_LABEL_EXPR, void_type_node, +TREE_VALUE (flt_node), NULL, lab); + VEC_safe_push (tree, heap, labels, t); + pointer_set_insert (seen_values, TREE_VALUE (flt_node)); + have_label = true; + } tp_node = TREE_CHAIN (tp_node); flt_node = TREE_CHAIN (flt_node); } while (tp_node); + if (! have_label) + remove_edge (find_edge (src, label_to_block (lab))); } /* Clean up the edge flags. */ @@ -3132,6 +3147,7 @@ lower_eh_dispatch (basic_block src, gimple stmt) VEC_free (tree, heap, labels); } + pointer_set_destroy (seen_values); } break; @@ -3185,6 +3201,8 @@ execute_lower_eh_dispatch (void) } } + if (any_rewritten) +delete_unreachable_blocks (); return any_rewritten ? TODO_update_ssa_only_virtuals : 0; } -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42859
[Bug target/42894] [4.5 Regression] Invalid rtl sharing in Thumb1.
--- Comment #8 from abel at gcc dot gnu dot org 2010-02-16 07:51 --- I needed explicit --enable-tls to reproduce this. The problem seems to be in dump_minipool. We are gathering values to fix in the Mnode structures and then we are issuing insns with those values. However, when a value is a constant, we get two insns with the same CONST: parts of the pattern, which is not permitted and is caught by the verifier. To fix this, it is enough to unshare the values before emitting. The below patch does this only for CONSTANT_P rtxes and fixes the bug. Is it fine or do we want to unconditionally unshare the rtx to be absolutely sure this will not happen again? I do not know ARM backend good enough to judge. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 466981a..2edae15 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -10917,6 +10917,8 @@ dump_minipool (rtx scan) { if (mp-refcount 0) { + rtx value; + if (dump_file) { fprintf (dump_file, @@ -10927,35 +10929,36 @@ dump_minipool (rtx scan) fputc ('\n', dump_file); } + value = CONSTANT_P (mp-value) ? copy_rtx (mp-value) : mp-value; switch (mp-fix_size) { #ifdef HAVE_consttable_1 case 1: - scan = emit_insn_after (gen_consttable_1 (mp-value), scan); + scan = emit_insn_after (gen_consttable_1 (value), scan); break; #endif #ifdef HAVE_consttable_2 case 2: - scan = emit_insn_after (gen_consttable_2 (mp-value), scan); + scan = emit_insn_after (gen_consttable_2 (value), scan); break; #endif #ifdef HAVE_consttable_4 case 4: - scan = emit_insn_after (gen_consttable_4 (mp-value), scan); + scan = emit_insn_after (gen_consttable_4 (value), scan); break; #endif #ifdef HAVE_consttable_8 case 8: - scan = emit_insn_after (gen_consttable_8 (mp-value), scan); + scan = emit_insn_after (gen_consttable_8 (value), scan); break; #endif #ifdef HAVE_consttable_16 case 16: - scan = emit_insn_after (gen_consttable_16 (mp-value), scan); + scan = emit_insn_after (gen_consttable_16 (value), scan); break; #endif -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42894
[Bug target/42894] [4.5 Regression] Invalid rtl sharing in Thumb1.
--- Comment #6 from abel at gcc dot gnu dot org 2010-02-12 10:25 --- I could take a look at this, but I cannot reproduce the ICE no matter how I try, both with the full and reduced testcases, both with current trunk and the one of Jan 29 (host x86-64, target arm-oe-linux-uclibceabi/arm-unknown-linux-gnueabi). Can someone tell exactly how the compiler should be configured? -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42894
[Bug rtl-optimization/42294] [4.5 Regression] ICE in code_motion_path_driver for 416.gamess
--- Comment #8 from abel at gcc dot gnu dot org 2010-01-14 10:16 --- Subject: Bug 42294 Author: abel Date: Thu Jan 14 10:16:01 2010 New Revision: 155889 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=155889 Log: PR rtl-optimization/42294 * sel-sched.c (try_replace_dest_reg): When chosen register and original register is the same, do not bail out early, but still check all original insns for validity of replacing destination register. Set EXPR_TARGET_AVAILABLE to 1 before leaving function in this case. Added: trunk/gcc/testsuite/gcc.dg/pr42249.c Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42294
[Bug rtl-optimization/42294] [4.5 Regression] ICE in code_motion_path_driver for 416.gamess
--- Comment #9 from abel at gcc dot gnu dot org 2010-01-14 10:17 --- Fixed by r155889. -- abel at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42294
[Bug rtl-optimization/42249] unrecognizable insn for 254.gap with sel-sched
--- Comment #1 from abel at gcc dot gnu dot org 2010-01-14 10:24 --- This is fixed by http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42294#c8, there was a typo in the bug number so the email didn't get in this audit trail. -- abel at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42249
[Bug rtl-optimization/42388] [4.5 Regression] ICE in move_bb_info with sel-sched and modulo-sched for 176.gcc
--- Comment #4 from abel at gcc dot gnu dot org 2010-01-14 11:02 --- Subject: Bug 42388 Author: abel Date: Thu Jan 14 11:02:18 2010 New Revision: 155894 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=155894 Log: PR rtl-optimization/42388 * sel-sched-ir.c (maybe_tidy_empty_bb): Do not delete empty blocks that have no predecessors nor successors. Do not call move_bb_info for empty blocks outside of current region. Added: trunk/gcc/testsuite/gcc.dg/pr42388.c Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched-ir.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42388
[Bug rtl-optimization/42389] ICE in advance_state_on_fence with sel-schd for 175.vpr
--- Comment #3 from abel at gcc dot gnu dot org 2010-01-14 11:07 --- Subject: Bug 42389 Author: abel Date: Thu Jan 14 11:07:39 2010 New Revision: 155895 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=155895 Log: PR rtl-optimization/42389 * sel-sched.c (advance_one_cycle): Set FENCE_ISSUE_MORE to can_issue_more. (advance_state_on_fence): Likewise. (sel_target_adjust_priority): Print debug output only when sched_verbose = 4, not 2. (get_expr_cost): Do not issue all unique insns on the next cycle. (fill_insns): Initialize can_issue_more from the value saved with the fence. * sel-sched-ir.c (flist_add): New parameter issue_more. Init FENCE_ISSUE_MORE with it. (merge_fences): Likewise. (init_fences): Update call to flist_add. (add_to_fences, add_clean_fence_to_fences) (add_dirty_fence_to_fences): Likewise. (move_fence_to_fences): Update call to merge_fences. (invoke_reorder_hooks): Do not reset can_issue_more on insns from sched groups. * sel-sched-ir.h (struct _fence): New field issue_more. (FENCE_ISSUE_MORE): New accessor macro. Added: trunk/gcc/testsuite/gcc.dg/pr42389.c Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched-ir.c trunk/gcc/sel-sched-ir.h trunk/gcc/sel-sched.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42389
[Bug rtl-optimization/42388] [4.5 Regression] ICE in move_bb_info with sel-sched and modulo-sched for 176.gcc
--- Comment #5 from abel at gcc dot gnu dot org 2010-01-14 11:08 --- Fixed. -- abel at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42388
[Bug rtl-optimization/42389] ICE in advance_state_on_fence with sel-schd for 175.vpr
--- Comment #4 from abel at gcc dot gnu dot org 2010-01-14 11:09 --- Fixed. -- abel at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42389
[Bug rtl-optimization/42246] ICE in init_seqno for 186.crafty with sel-sched
--- Comment #6 from abel at gcc dot gnu dot org 2010-01-14 11:22 --- Subject: Bug 42246 Author: abel Date: Thu Jan 14 11:22:20 2010 New Revision: 155900 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=155900 Log: PR rtl-optimization/42246 * sel-sched-ir.h (get_all_loop_exits): Include exits from inner loops. Added: trunk/gcc/testsuite/gfortran.dg/pr42246-2.f Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched-ir.h trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42246
[Bug rtl-optimization/42246] ICE in init_seqno for 186.crafty with sel-sched
--- Comment #7 from abel at gcc dot gnu dot org 2010-01-14 11:23 --- Fixed by the above patches. -- abel at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42246
[Bug target/42295] ICE: 'error: unable to find a register to spill in class AREG' with -fschedule-insns
--- Comment #5 from abel at gcc dot gnu dot org 2010-01-14 11:32 --- With the recent patches to sel-sched, testcases from comments #3 and #4 do not longer fail for me. I'm still seeing the spill failure of the original report though. -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42295
[Bug rtl-optimization/42246] ICE in init_seqno for 186.crafty with sel-sched
--- Comment #4 from abel at gcc dot gnu dot org 2010-01-11 14:35 --- (In reply to comment #2) This is the other bug in our region walk iterator that happens when pipelining outer loops. When looking for loop exits from an inner loop that is contained in the outer loop currently being pipelined, we need to work harder to skip several consecutive inner loops if needed. The iterator assumes that all preheaders of inner loops are available, so when skipping an inner loop, it expects to find a block of an outer loop (which is possibly the preheader of the next inner loop). When we are removing empty blocks in the region body, this is not the case, and we are immediately hitting the header of the next inner loop. Fortunately, the bug is rather easily fixed by using the already implemented infrastructure as below. * sel-sched-ir.h (get_all_loop_exits): Include exits from inner loops. diff --git a/gcc/sel-sched-ir.h b/gcc/sel-sched-ir.h index 06082ac..317258c 100644 --- a/gcc/sel-sched-ir.h +++ b/gcc/sel-sched-ir.h @@ -1147,7 +1147,8 @@ get_all_loop_exits (basic_block bb) /* Traverse all loop headers. */ for (i = 0; VEC_iterate (edge, exits, i, e); i++) - if (in_current_region_p (e-dest)) + if (in_current_region_p (e-dest) + || inner_loop_header_p (e-dest)) { VEC(edge, heap) *next_exits = get_all_loop_exits (e-dest); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42246
[Bug middle-end/42245] ICE in verify_backedges for 197.parser with sel-sched
--- Comment #3 from abel at gcc dot gnu dot org 2009-12-28 12:06 --- The patch mentioned by Alexander is not enough to fix the bug after applying all other patches for sel-sched bugs. The actual problem is that when redirecting an edge, the topological order of blocks in the currently scheduling region may be broken. I had a patch to fix this, but didn't apply it to trunk so got beaten by it. We will post it shortly. * sel-sched-ir.c (sel_redirect_edge_and_branch): Recompute topological order after redirecting an edge if needed. diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 645093a..2baa461 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -5394,6 +5394,27 @@ sel_redirect_edge_and_branch (edge e, basic_block to) gcc_assert (loop_latch_edge (current_loop_nest)); } + /* In rare situations, the topological relation between the blocks connected + by the redirected edge can change. Update block_to_bb/bb_to_block. */ + if (CONTAINING_RGN (e-src-index) == CONTAINING_RGN (to-index) + BLOCK_TO_BB (e-src-index) BLOCK_TO_BB (to-index)) +{ + int i, n, rgn; + int *postorder, n_blocks; + + postorder = XALLOCAVEC (int, n_basic_blocks); + n_blocks = post_order_compute (postorder, false, false); + + rgn = CONTAINING_RGN (e-src-index); + for (n = 0, i = n_blocks - 1; i = 0; i--) +if (CONTAINING_RGN (postorder[i]) == rgn) + { +BLOCK_TO_BB (postorder[i]) = n; +BB_TO_BLOCK (n) = postorder[i]; +n++; + } +} + jump = find_new_jump (src, NULL, prev_max_uid); if (jump) sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP); -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42245
[Bug rtl-optimization/42389] ICE in advance_state_on_fence with sel-schd for 175.vpr
--- Comment #2 from abel at gcc dot gnu dot org 2009-12-25 10:44 --- Confirmed. This needs my uncommitted patch from http://gcc.gnu.org/ml/gcc-patches/2008-09/msg01931.html (which is correctly saving and restoring can_issue_more variable in the presence of multiple scheduling points) amended by the below fix by Alexander, as the original patch failed to update one place. The -fsched-pressure flag has anything to do with the bug only because on ppc64 it results in the different value of issue_rate. Again we will need help with testing this on ppc64 as a combined patch with other bugfixes. diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -4103,7 +4104,7 @@ invoke_reorder_hooks (fence_t fence) ran_hook = true; } else -issue_more = issue_rate; +issue_more = FENCE_ISSUE_MORE (fence); -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org, ||amonakov at gcc dot gnu dot ||org AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-12-25 10:44:11 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42389
[Bug rtl-optimization/42294] [4.5 Regression] ICE in code_motion_path_driver for 416.gamess
--- Comment #7 from abel at gcc dot gnu dot org 2009-12-24 08:18 --- The problem here is in the incorrect handling of the transformation history. When an insn is transformed (i.e. substituted/speculated), this is recorded so that the insn could be found during upward code motion. Part of the data recorded is the uid of insn on which the transformation happened. As this second insn could get removed while filling a parallel group, and its bookkeeping copy could be created, we need to undo the transformation while moving through this copy instead of original insn. To do this, we also maintain a bitmap of insn uids that could generate the copy (INSN_ORIGINATORS), and we also check it on the copies. The actual bug was that the bitmap should contain all ancestor insns of a copy, not only parents, as the copy found could originated from another copy (yes, I was stupid of not thinking about this earlier). The alternate solution would be to make the search function recurse on INSN_ORIGINATORS bitmap, but this one seemed clearer. Patch by Alexander below, we would need to ask someone with access to ppc64 to test it (as a part of combined patch fixing other sel-sched bugs) in addition to our testing. * sel-sched-ir.h (struct _sel_insn_data): Update comment. * sel-sched.c (move_exprs_to_boundary): Transitively add all originators' originators. --- gcc/sel-sched-ir.h |3 ++- gcc/sel-sched.c|9 + 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/gcc/sel-sched-ir.h b/gcc/sel-sched-ir.h index 1950a65..67b5b62 100644 --- a/gcc/sel-sched-ir.h +++ b/gcc/sel-sched-ir.h @@ -715,7 +715,8 @@ struct _sel_insn_data bitmap found_deps; /* An INSN_UID bit is set when this is a bookkeeping insn generated from - a parent with this uid. */ + a parent with this uid. If a parent is a bookkeeping copy, all its + originators are transitively included in this set. */ bitmap originators; /* A hashtable caching the result of insn transformations through this one. */ diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index e5ebc57..9fcc633 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -5211,12 +5211,21 @@ move_exprs_to_boundary (bnd_t bnd, expr_t expr_vliw, EXECUTE_IF_SET_IN_BITMAP (current_copies, 0, book_uid, bi) { + unsigned uid; + bitmap_iterator bi; + /* We allocate these bitmaps lazily. */ if (! INSN_ORIGINATORS_BY_UID (book_uid)) INSN_ORIGINATORS_BY_UID (book_uid) = BITMAP_ALLOC (NULL); bitmap_copy (INSN_ORIGINATORS_BY_UID (book_uid), current_originators); + + /* Transitively add all originators' originators. */ + EXECUTE_IF_SET_IN_BITMAP (current_originators, 0, uid, bi) + if (INSN_ORIGINATORS_BY_UID (uid)) +bitmap_ior_into (INSN_ORIGINATORS_BY_UID (book_uid), + INSN_ORIGINATORS_BY_UID (uid)); } return should_move; -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42294
[Bug rtl-optimization/42246] ICE in init_seqno for 186.crafty with sel-sched
--- Comment #1 from abel at gcc dot gnu dot org 2009-12-24 08:32 --- Here, we broke pipelining of outer loops when optimizing the scheduler core. The problems analyzed by Alexander are simple though. First, when testing whether a loop is considered for pipelining, I decided to play safe and also check pipelining_p in addition to the flag in the aux loop data that was designed specially for this. Naturally, when we then disabled pipelining_p for rescheduling pipelined loops, this broke, so to fix it we just need to stop checking for pipelining_p. The second problem is that we use the last_added_blocks vector when adding blocks to the region, and we failed to initialize it correctly for the case of moving preheader blocks from an inner loop to an outer loop when we have added the vector. Also easily fixed via correctly initializing the vector. Again, we would ask someone with access to ppc/ppc64 to test this patch as a part of the combined patch with fixes for all sel-sched bugs, when our testing will be completed. This patch also fixes PR39453. * sel-sched-ir.c (considered_for_pipelining_p): Do not test for pipelining_p. (sel_add_loop_preheaders): Add preheader to last_added_blocks. --- gcc/sel-sched-ir.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 2469822..3c2989a 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -5825,7 +5825,7 @@ considered_for_pipelining_p (struct loop *loop) latch. We can't use header here, because this header could be just removed preheader and it will give us the wrong region number. Latch can't be used because it could be in the inner loop too. */ - if (LOOP_MARKED_FOR_PIPELINING_P (loop) pipelining_p) + if (LOOP_MARKED_FOR_PIPELINING_P (loop)) { int rgn = CONTAINING_RGN (loop-latch-index); @@ -5974,7 +5974,10 @@ sel_add_loop_preheaders (void) for (i = 0; VEC_iterate (basic_block, preheader_blocks, i, bb); i++) +{ + VEC_safe_push (basic_block, heap, last_added_blocks, bb); sel_add_bb (bb); +} VEC_free (basic_block, heap, preheader_blocks); } -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42246
[Bug rtl-optimization/42388] [4.5 Regression] ICE in move_bb_info with sel-sched and modulo-sched for 176.gcc
--- Comment #3 from abel at gcc dot gnu dot org 2009-12-24 07:39 --- The problem was that the failing assert is actually too strict, when an empty block is removed, its predecessor could be outside the region. After fixing this, I have also further robustified the function to expect empty blocks with no succs or preds, as this problem showed itself yet another time via the single failed test of the patch on ia64. * sel-sched-ir.c (maybe_tidy_empty_bb): Do not delete empty blocks that have no predecessors nor successors. Do not call move_bb_info for empty blocks outside of current region. --- gcc/sel-sched-ir.c | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 3c2989a..0950f2a 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -3519,12 +3519,15 @@ maybe_tidy_empty_bb (basic_block bb) bool rescan_p; /* Keep empty bb only if this block immediately precedes EXIT and - has incoming non-fallthrough edge. Otherwise remove it. */ + has incoming non-fallthrough edge, or it has no predecessors or + successors. Otherwise remove it. */ if (!sel_bb_empty_p (bb) || (single_succ_p (bb) single_succ (bb) == EXIT_BLOCK_PTR (!single_pred_p (bb) - || !(single_pred_edge (bb)-flags EDGE_FALLTHRU + || !(single_pred_edge (bb)-flags EDGE_FALLTHRU))) + || EDGE_COUNT (bb-preds) == 0 + || EDGE_COUNT (bb-succs) == 0) return false; /* Do not attempt to redirect complex edges. */ @@ -3574,7 +3577,8 @@ maybe_tidy_empty_bb (basic_block bb) { gcc_assert (pred_bb != NULL); - move_bb_info (pred_bb, bb); + if (in_current_region_p (pred_bb)) + move_bb_info (pred_bb, bb); remove_empty_bb (bb, true); } -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org, ||amonakov at gcc dot gnu dot ||org AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-12-24 07:39:24 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42388
[Bug rtl-optimization/39453] ICE : in init_seqno, at sel-sched.c:6433
--- Comment #5 from abel at gcc dot gnu dot org 2009-12-21 11:38 --- Me and Alexander will be looking at this together with the sel-sched ppc bugs. -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org, ||amonakov at gcc dot gnu dot ||org AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|NEW |ASSIGNED Last reconfirmed|2009-03-13 14:08:02 |2009-12-21 11:38:53 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39453
[Bug rtl-optimization/41697] ICE on gcc.c-torture/compile/20090917-1.c
--- Comment #3 from abel at gcc dot gnu dot org 2009-11-13 14:33 --- Subject: Bug 41697 Author: abel Date: Fri Nov 13 14:32:52 2009 New Revision: 154148 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154148 Log: PR rtl-optimization/41697 * sel-sched-ir.c (fallthru_bb_of_jump): Bail out when a block with a conditional jump has a single successor. Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched-ir.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41697
[Bug rtl-optimization/41033] RTL alias-oracle does not honor -fno-strict-aliasing
--- Comment #5 from abel at gcc dot gnu dot org 2009-08-13 08:12 --- Fixed in trunk, 4.3 and 4.4. -- abel at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41033
[Bug rtl-optimization/41033] RTL alias-oracle does not honor -fno-strict-aliasing
--- Comment #1 from abel at gcc dot gnu dot org 2009-08-12 07:40 --- Confirmed on trunk. As we discussed on IRC, the below obvious patch makes nonoverlapping_component_refs_p punt when !flag_strict_aliasing and thus fixes the testcase. I have looked at the other rtl alias oracle functions used in *_dependence, and it seems that they are safe. E.g., fixed_scalar_and_varying_struct_p already punts when fno-strict-aliasing, and the other stuff mainly deals with base+offset disambiguations. (Interestingly enough, I couldn't make a test case in which incorrect PRE or CSE (not DSE) would happen, as these probably don't look through stores. On some platforms though, the scheduler will likely fail.) I will post the patch after bootstrap+regtest. Index: alias.c === *** alias.c (revision 150675) --- alias.c (working copy) *** nonoverlapping_component_refs_p (const_t *** 1980,1985 --- 1980,1988 { const_tree fieldx, fieldy, typex, typey, orig_y; + if (!flag_strict_aliasing) + return false; + do { /* The comparison has to be done at a common type, since we don't -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-08-12 07:40:55 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41033
[Bug rtl-optimization/41033] RTL alias-oracle does not honor -fno-strict-aliasing
--- Comment #2 from abel at gcc dot gnu dot org 2009-08-12 11:50 --- Subject: Bug 41033 Author: abel Date: Wed Aug 12 11:50:22 2009 New Revision: 150680 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=150680 Log: 2009-08-12 Andrey Belevantsev a...@ispras.ru PR rtl-optimization/41033 * alias.c (nonoverlapping_component_refs_p): Punt if strict aliasing is disabled. 2009-08-12 Richard Guenther rguent...@suse.de PR rtl-optimization/41033 * gcc.dg/pr41033.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr41033.c Modified: trunk/gcc/ChangeLog trunk/gcc/alias.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41033
[Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
--- Comment #4 from abel at gcc dot gnu dot org 2009-05-29 15:33 --- Subject: Bug 40101 Author: abel Date: Fri May 29 15:33:17 2009 New Revision: 147977 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=147977 Log: PR rtl-optimization/40101 * sel-sched-ir.c (get_seqno_by_preds): Allow returning negative seqno. Adjust comment. * sel-sched.c (find_seqno_for_bookkeeping): Assert that when inserting bookkeeping before a jump, the jump is not scheduled. When no positive seqno found, provide a value. Add comment. Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched-ir.c trunk/gcc/sel-sched.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101
[Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
--- Comment #5 from abel at gcc dot gnu dot org 2009-05-29 15:37 --- Fixed. -- abel at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101
[Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
--- Comment #3 from abel at gcc dot gnu dot org 2009-05-26 12:19 --- I have further looked at seqno handling, and it seems that we can't rip it off without changing the region walking logic pretty much. Seqnos are computed in such a way that they mark the stage (the number of iteration of scheduling loop) on which a parallel group of insns has been scheduled. That is, if all insns scheduled within the first iteration on fences will get #1, all insns scheduled within the second iteration will get #2, this will be pretty much equivalent. Walking from higher to lower seqnos is prohibited, but not only to mark the dynamic back-edge, but to forbid moving insns from earlier scheduling iterations to later ones. E.g., when pipelining, we can move insns from stage #2 to #0 (yet unscheduled code), possibly through insns from stage #1, but we cannot move insns from stage #1 to #0 through insns belonging to stage #2. This logic is modeled by existing seqnos, so we cannot rip seqnos off without changing the logic. We can simplify it very slightly by making seqnos to be plain iteration numbers like described above, but that would not allow removing any code as I hoped. We can also change this logic so that any movements from scheduled to unscheduled code is possible for pipelining, but that would require much more work and some tuning (I would probably try that later, but not for this bug). Thus, I would fix just the bug for now. The fix is quite simple. In the situations like in the testcase, no positive seqnos around the bookkeeping insn means that the fences will not be able to get to it. This normally happens during pipelining, though quite rare, so we have a code for this that would pick up unscheduled bookkeeping and schedule it afterwards. This logic will deal with the test case, too. We just need to assign pretty much arbitrary positive seqno in this case. So the following patch fixes the test case (it passes all SPECs) and bootstraps on ia64 with sel-sched enabled at -O2, testing is in progress. I will post it to gcc-patches if the testing will look fine. Index: gcc/sel-sched.c === *** gcc/sel-sched.c (revision 147558) --- gcc/sel-sched.c (working copy) *** find_seqno_for_bookkeeping (insn_t place *** 4524,4534 if (INSN_P (next) JUMP_P (next) BLOCK_FOR_INSN (next) == BLOCK_FOR_INSN (place_to_insert)) ! seqno = INSN_SEQNO (next); else if (INSN_SEQNO (join_point) 0) seqno = INSN_SEQNO (join_point); else ! seqno = get_seqno_by_preds (place_to_insert); gcc_assert (seqno 0); return seqno; --- 4524,4550 if (INSN_P (next) JUMP_P (next) BLOCK_FOR_INSN (next) == BLOCK_FOR_INSN (place_to_insert)) ! { ! gcc_assert (INSN_SCHED_TIMES (next) == 0); ! seqno = INSN_SEQNO (next); ! } else if (INSN_SEQNO (join_point) 0) seqno = INSN_SEQNO (join_point); else ! { ! seqno = get_seqno_by_preds (place_to_insert); ! ! /* Sometimes the fences can move in such a way that there will be ! no instructions with positive seqno around this bookkeeping. ! This means that there will be no way to get to it by a regular ! fence movement. Never mind because we pick up such pieces for ! rescheduling anyways, so any positive value will do for now. */ ! if (seqno 0) ! { ! gcc_assert (pipelining_p); ! seqno = 42; ! } ! } gcc_assert (seqno 0); return seqno; Index: gcc/sel-sched-ir.c === *** gcc/sel-sched-ir.c (revision 147558) --- gcc/sel-sched-ir.c (working copy) *** get_seqno_of_a_pred (insn_t insn) *** 3730,3736 return seqno; } ! /* Find the proper seqno for inserting at INSN. */ int get_seqno_by_preds (rtx insn) { --- 3730,3737 return seqno; } ! /* Find the proper seqno for inserting at INSN. Returns -1 if no predecessors ! with positive seqno exist. */ int get_seqno_by_preds (rtx insn) { *** get_seqno_by_preds (rtx insn) *** 3749,3755 for (i = 0, seqno = -1; i n; i++) seqno = MAX (seqno, INSN_SEQNO (preds[i])); - gcc_assert (seqno 0); return seqno; } --- 3750,3755 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101
[Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
--- Comment #2 from abel at gcc dot gnu dot org 2009-05-15 13:20 --- The bug happens when we compute a seqno for the newly created bookkeping insn. Seqnos exist in the algorithm (roughly) to guide the movement of fences so that, first, all unscheduled insns will be found and scheduled, and second, dynamic back-edges during pipelining will be properly marked. The assert we hit just means that the existing code was unable to compute the proper seqno, because it looks only on direct succs/preds of the place we want to insert bookkeeping, yet in the test case the fences are processed in such an order that all of those succs/preds are already scheduled (we're pipelining). The fix would be to extend this code to walk further to find yet unscheduled insns and to derive the seqno from them. However, thinking about it further, I believe that we can get rid of seqnos altogether. We already have topological sorting for basic blocks in the scheduler, and it should be enough just to check that we don't hit other fence or already visited insn (or already scheduled insn if no pipelining) when computing our availability sets, and it should be enough just to move fences to unscheduled code. The original approach also used seqnos to mark parallel groups, but this is not needed for gcc. So, as we are in Stage 1, and there is no rush with this bug, I will try to get rid of seqnos first. In case it turns out I've overlooked anything, I will resort to the former, more conservative fix. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101
[Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
--- Comment #1 from abel at gcc dot gnu dot org 2009-05-14 14:12 --- Confirmed, I'll take a look. (Somehow my ispras.ru account didn't get any mails about this bug.) -- abel at gcc dot gnu dot org changed: What|Removed |Added CC|abel at ispras dot ru |abel at gcc dot gnu dot org AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-05-14 14:12:49 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101
[Bug rtl-optimization/39580] [4.5 regression] Revision 145204 caused libgomp.c++/collapse-2.C
--- Comment #5 from abel at gcc dot gnu dot org 2009-04-22 15:26 --- Subject: Bug 39580 Author: abel Date: Wed Apr 22 15:25:58 2009 New Revision: 146588 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=146588 Log: PR rtl-optimization/39580 * sel-sched-ir.c (insert_in_history_vect): Remove incorrect gcc_assert. Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched-ir.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39580
[Bug rtl-optimization/39580] [4.5 regression] Revision 145204 caused libgomp.c++/collapse-2.C
--- Comment #6 from abel at gcc dot gnu dot org 2009-04-22 15:28 --- Fixed by the above patch. -- abel at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39580
[Bug rtl-optimization/39580] [4.5 regression] Revision 145204 caused libgomp.c++/collapse-2.C
--- Comment #3 from abel at gcc dot gnu dot org 2009-04-21 11:47 --- Confirmed. I will take a look. -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at ispras dot ru AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-04-21 11:47:05 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39580
[Bug rtl-optimization/39580] [4.5 regression] Revision 145204 caused libgomp.c++/collapse-2.C
--- Comment #4 from abel at gcc dot gnu dot org 2009-04-21 14:16 --- What happens in the test is that when pipelining, after several consecutive substitutions we end up with moving expressions r64=r16-r16 and r64=r16-r51 through r16=r51, after which both expressions become r64=r51-r51, as a result of substitution. When merging these expressions, we hit an assert in insert_in_history_vect. This assert tries to describe the situations when earlier different, and now same expressions would have similar entries in their history of changes vector, i.e. somewhere on their way up they were transformed on the same insn. The main thing in the assert is that both expressions are supposed to be equal before this transformation was recorded. Now we have a test case when this is not the case. I presume that we didn't hit this before because the situations like ' b = c; a = b - c; ' are quite rare. We have two choices: either to extend the assert to cover this case or to remove it completely. If we'd extend it, then the assert becomes not very useful, as it basically says that all variations in the above situation are possible. So I'm inclined just to remove it. This would not hurt correctness, only in extreme rare situations like this we'd not be able to find both expressions to move them up, but only the one, as history vector has a single entry per uid, and thus we'd be unable to perform unification. So I will bootstrap/regtest the below patch. Index: gcc/sel-sched-ir.c === *** gcc/sel-sched-ir.c (revision 146520) --- gcc/sel-sched-ir.c (working copy) *** insert_in_history_vect (VEC (expr_histor *** 1512,1525 { expr_history_def *phist = VEC_index (expr_history_def, vect, ind); - /* When merging, either old vinsns are the *same* or, if not, both - old and new vinsns are different pointers. In the latter case, - though, new vinsns should be equal. */ - gcc_assert (phist-old_expr_vinsn == old_expr_vinsn - || (phist-new_expr_vinsn != new_expr_vinsn -(vinsn_equal_p - (phist-old_expr_vinsn, old_expr_vinsn; - /* It is possible that speculation types of expressions that were propagated through different paths will be different here. In this case, merge the status to get the correct check later. */ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39580
[Bug middle-end/39794] New: Miscompile with -O2 -funroll-loops
The following testcase aborts with -O2 -funroll-loops, but passes with plain -O2 for me on today's trunk. --cut here extern void abort(); void foo(int *a, int n) { int i; for (i = 0; i n; i++) { a[i] *= 2; a[i+1] = a[i-1] + a[i-2]; } } enum {N = 16}; int a[N]; int ref[N] = {0, 1, 4, 2, 10, 12, 24, 44, 72, 136, 232, 416, 736, 1296, 2304, 2032}; int main() { int i; for (i = 0; i N; i++) a[i] = i; foo(a + 2, N - 3); for (i = 0; i N; i++) if (ref[i] != a[i]) abort(); return 0; } -- cut here -- Summary: Miscompile with -O2 -funroll-loops Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: abel at gcc dot gnu dot org GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39794
[Bug target/31850] gcc.c-torture/compile/limits-fnargs.c is slow at compiling for spu-elf
--- Comment #14 from abel at gcc dot gnu dot org 2008-11-27 12:50 --- (In reply to comment #13) (In reply to comment #12) Thanks, Andrey. I think there are 2 issues here: 1. register-renaming. (more related to this PR, I think) 2. schuedule-insns. Both of them slows compilation. With ARG4, on SPU, I see: -O1: 9m28.355s -O1 -fno-rename-registers:0m19.196s -O2: 184m37.492s (not 1000 as I wrote, but 100) -O2 -fno-rename-registers: 31m29.482s -O2 -fno-schedule-insns: 10m26.851s -O2 -fno-rename-registers -fno-schedule-insns: 0m39.425s Do you see this on ppc to spu cross? How was your compiler configured? I will try again with the full test case when you'll tell me your configure options. (For my reduced test case, all scheduling was around 10% without register renaming, as you can see from cc1 output, which is why I didn't look further into this.) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31850
[Bug target/31850] gcc.c-torture/compile/limits-fnargs.c is slow at compiling for spu-elf
--- Comment #12 from abel at gcc dot gnu dot org 2008-11-25 14:28 --- I have somewhat cut the testcase, having the call with two ARG3's instead of ten coming from ARG4. With this smaller testcase, I see that the most time is taken by register renaming (cross to spu-elf, compiled with -O2): scheduling: 0.66 ( 2%) usr 0.03 (30%) sys 0.69 ( 2%) wall 19208 kB (32%) ggc integrated RA : 4.55 (11%) usr 0.00 ( 0%) sys 4.53 (11%) wall 829 kB ( 1%) ggc reload: 2.57 ( 6%) usr 0.01 (10%) sys 2.58 ( 6%) wall 11996 kB (20%) ggc reload CSE regs : 0.23 ( 1%) usr 0.00 ( 0%) sys 0.22 ( 1%) wall 2940 kB ( 5%) ggc peephole 2: 0.01 ( 0%) usr 0.00 ( 0%) sys 0.01 ( 0%) wall 0 kB ( 0%) ggc rename registers : 32.21 (76%) usr 0.01 (10%) sys 32.22 (75%) wall 993 kB ( 2%) ggc scheduling 2 : 0.58 ( 1%) usr 0.03 (30%) sys 0.61 ( 1%) wall 5375 kB ( 9%) ggc machine dep reorg : 0.59 ( 1%) usr 0.01 (10%) sys 0.60 ( 1%) wall 5569 kB ( 9%) ggc final : 0.04 ( 0%) usr 0.00 ( 0%) sys 0.05 ( 0%) wall 0 kB ( 0%) ggc TOTAL : 42.59 0.1042.71 59919 kB With -O2 -fno-rename-registers, I get scheduling: 0.66 ( 6%) usr 0.04 (36%) sys 0.70 ( 7%) wall 19208 kB (33%) ggc integrated RA : 4.56 (45%) usr 0.00 ( 0%) sys 4.57 (44%) wall 829 kB ( 1%) ggc reload: 2.58 (25%) usr 0.00 ( 0%) sys 2.59 (25%) wall 11996 kB (21%) ggc reload CSE regs : 0.23 ( 2%) usr 0.00 ( 0%) sys 0.24 ( 2%) wall 2940 kB ( 5%) ggc thread pro- epilogue: 0.01 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall 22 kB ( 0%) ggc peephole 2: 0.01 ( 0%) usr 0.00 ( 0%) sys 0.02 ( 0%) wall 0 kB ( 0%) ggc rename registers : 0.04 ( 0%) usr 0.00 ( 0%) sys 0.04 ( 0%) wall 0 kB ( 0%) ggc scheduling 2 : 0.49 ( 5%) usr 0.04 (36%) sys 0.52 ( 5%) wall 4949 kB ( 9%) ggc machine dep reorg : 0.50 ( 5%) usr 0.02 (18%) sys 0.51 ( 5%) wall 5055 kB ( 9%) ggc reorder blocks: 0.01 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall 0 kB ( 0%) ggc final : 0.05 ( 0%) usr 0.00 ( 0%) sys 0.05 ( 0%) wall 0 kB ( 0%) ggc TOTAL : 10.21 0.1110.35 57732 kB -frename-registers is enabled by default on spu, so no wonder this is not seen on other targets. oprofile shows me this: Samples %linenr info image name app name symbol name --- 362678 29.6888 rtlanal.c:1412 cc1 cc1 note_stores 362678 100.000 rtlanal.c:1412 cc1 cc1 note_stores [self] --- 304520 24.9280 regrename.c:1941cc1 cc1 rest_of_handle_regrename 304520 99.8727 regrename.c:1941cc1 cc1 rest_of_handle_regrename [self] 201 0.0659 bitmap.c:630cc1 cc1 bitmap_set_bit 990.0325 df-scan.c:1217 cc1 cc1 df_insn_rescan 390.0128 df-problems.c:107 cc1 cc1 df_grow_bb_info 240.0079 (no location information) cc1 cc1 bitmap_clear_bit 170.0056 df-scan.c:573 cc1 cc1 df_grow_reg_info 8 0.0026 emit-rtl.c:1131 cc1 cc1 max_reg_num --- 164550 13.4701 regrename.c:120 cc1 cc1 clear_dead_regs 164550 100.000 regrename.c:120 cc1 cc1 clear_dead_regs [self] --- 6441 100.000 ira-color.c:1044cc1 cc1 allocno_spill_priority_compare 59894 4.9029 ira-color.c:1044cc1 cc1 allocno_spill_priority_compare 5989486.6547 ira-color.c:1044cc1 cc1 allocno_spill_priority_compare [self] 6441 9.3188 ira-color.c:1044cc1 cc1 allocno_spill_priority_compare 1148 1.6609 splay-tree.c:348cc1
[Bug target/37381] [4.4 Regression] ICE in ia64_speculate_insn, at config/ia64/ia64.c:6902
--- Comment #7 from abel at gcc dot gnu dot org 2008-09-22 06:20 --- The patch implementing ia64 changes needed for the selective scheduler can be found at http://gcc.gnu.org/ml/gcc-patches/2008-08/msg01669.html. [The first version of the patch with some summary is at http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00117.html. What is changed from that summary is that per Ian's suggestion we call compute_alignments from machine_reorg manually instead of rearranging the pass sequence.] I was going to ping them, but HJ did that first. It is important that we get that in for 4.4, because otherwise selective scheduler will be non-functional on ia64. However, I presume reviewing the changes will take some time, so it could make sense to fix this bug first. The patch for the bug is simple, and it is not a problem to revert it when committing the rest of sel-sched changes. On the sel-sched branch, I have restored the config/ia64/* files to be in line with mainline before merge. I will revert this on a branch in two-three days, so that the sel-sched branch will contain a fully functional selective scheduler on ia64. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37381
[Bug middle-end/37499] [4.4 Regression] Scheduling pass 2 time increases by order of magnitude
--- Comment #3 from abel at gcc dot gnu dot org 2008-09-15 09:02 --- I have checked that this is because of the selective scheduler merge. I will look at it. -- abel at gcc dot gnu dot org changed: What|Removed |Added CC||abel at gcc dot gnu dot org AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2008-09-15 09:02:56 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37499
[Bug rtl-optimization/37360] [4.4 Regression] ICE in haifa-sched.c when compiling __popcountsi2 from libgcc
-- abel at gcc dot gnu dot org changed: What|Removed |Added CC|abel at ispras dot ru |abel at gcc dot gnu dot org AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2008-09-09 12:56:38 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37360
[Bug rtl-optimization/37360] [4.4 Regression] ICE in haifa-sched.c when compiling __popcountsi2 from libgcc
--- Comment #18 from abel at gcc dot gnu dot org 2008-09-09 14:21 --- Subject: Bug 37360 Author: abel Date: Tue Sep 9 14:19:31 2008 New Revision: 140151 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=140151 Log: PR rtl-optimization/37360 * haifa-sched.c (max_issue): Do not assert that we never issue more insns than issue_rate. Add comment. Modified: trunk/gcc/ChangeLog trunk/gcc/haifa-sched.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37360
[Bug rtl-optimization/37360] [4.4 Regression] ICE in haifa-sched.c when compiling __popcountsi2 from libgcc
--- Comment #19 from abel at gcc dot gnu dot org 2008-09-09 14:35 --- Fixed in 140151. -- abel at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37360