[Bug middle-end/32349] [4.3 Regression] ICE in df_refs_verify with -O2 -fmodulo-sched for spec tests
zadeck at naturalbridge dot com
gcc-bugzilla@gcc.gnu.org
Sun Jun 17 17:52:00 GMT 2007
------- Comment #5 from zadeck at naturalbridge dot com 2007-06-17 17:52 -------
Subject: Re: [4.3 Regression] ICE in df_refs_verify
with -O2 -fmodulo-sched for spec tests
committed as revision 125776
Kenneth Zadeck wrote:
> This patch fixes the df issues with modulo scheduling. It simply never
> worked and was not tested because there is no default test coverage for it.
>
> I have added the testcase that janis sent me, but this is a completely
> inadequate test for this pass.
>
> Janis did test this fix with the spec benchmarks on the ppc and it did
> work.
>
>
> The last frag was suggested by stevenb. If you free the dominance info
> before gettting out of cfglayout it is faster since the dominance does
> not have to be updated.
>
> 2007-06-17 Kenneth Zadeck <zadeck@naturalbridge.com>
>
> PR middle-end/32349
> * modulo-sched (generate_reg_moves): Added rescan parameter and if
> this is true, rescan insn being modified.
> (sms_schedule): Added rescan parameter.
> (rest_of_handle_sms): Moved freeing of dominance info to before
> getting out of cfg_layout.
>
> 2007-06-17 Kenneth Zadeck <zadeck@naturalbridge.com>
>
> * gcc.c-torture/compile/pr32349.c: New testcase.
>
> ok to commit?
>
> Kenny
>
> ------------------------------------------------------------------------
>
> Index: testsuite/gcc.c-torture/compile/pr32349.c
> ===================================================================
> --- testsuite/gcc.c-torture/compile/pr32349.c (revision 0)
> +++ testsuite/gcc.c-torture/compile/pr32349.c (revision 0)
> @@ -0,0 +1,26 @@
> +/* { dg-options "-O2 -fmodulo-sched" } */
> +
> +
> +extern long *x1, *x2, *x3;
> +
> +int
> +foo ()
> +{
> + /* Switching the following two lines prevents the ICE. */
> + long *p1, *p2;
> + long m, n, i;
> +
> + p1 = x1;
> + p2 = x2;
> + n = 0;
> + for (i = *x3; 0 < i; i--)
> + {
> + m = (*p1++) ^ (*p2++);
> + m = (m & 0x55555555) + ((m >> 1) & 0x55555555);
> + m = (m & 0x33333333) + ((m >> 2) & 0x33333333);
> + m = (m + (m >> 4)) & 0x0f0f0f0f;
> + m = (m + (m >> 8));
> + n += m;
> + }
> + return n;
> +}
> Index: modulo-sched.c
> ===================================================================
> --- modulo-sched.c (revision 125775)
> +++ modulo-sched.c (working copy)
> @@ -426,7 +426,7 @@ calculate_maxii (ddg_ptr g)
> ii { 1 if not.
> */
> static struct undo_replace_buff_elem *
> -generate_reg_moves (partial_schedule_ptr ps)
> +generate_reg_moves (partial_schedule_ptr ps, bool rescan)
> {
> ddg_ptr g = ps->g;
> int ii = ps->ii;
> @@ -523,6 +523,8 @@ generate_reg_moves (partial_schedule_ptr
> }
>
> replace_rtx (g->nodes[i_use].insn, old_reg, new_reg);
> + if (rescan)
> + df_insn_rescan (g->nodes[i_use].insn);
> }
>
> prev_reg = new_reg;
> @@ -1151,7 +1153,7 @@ sms_schedule (void)
>
> /* Generate the kernel just to be able to measure its cycles. */
> permute_partial_schedule (ps, g->closing_branch->first_note);
> - reg_move_replaces = generate_reg_moves (ps);
> + reg_move_replaces = generate_reg_moves (ps, false);
>
> /* Get the number of cycles the new kernel expect to execute in. */
> new_cycles = kernel_number_of_cycles (BB_HEAD (g->bb), BB_END (g->bb));
> @@ -1201,7 +1203,7 @@ sms_schedule (void)
> /* The life-info is not valid any more. */
> df_set_bb_dirty (g->bb);
>
> - reg_move_replaces = generate_reg_moves (ps);
> + reg_move_replaces = generate_reg_moves (ps, true);
> if (dump_file)
> print_node_sched_params (dump_file, g->num_nodes);
> /* Generate prolog and epilog. */
> @@ -2481,8 +2483,8 @@ rest_of_handle_sms (void)
> FOR_EACH_BB (bb)
> if (bb->next_bb != EXIT_BLOCK_PTR)
> bb->aux = bb->next_bb;
> - cfg_layout_finalize ();
> free_dominance_info (CDI_DOMINATORS);
> + cfg_layout_finalize ();
> #endif /* INSN_SCHEDULING */
> return 0;
> }
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32349
More information about the Gcc-bugs
mailing list