[Bug rtl-optimization/89768] [7/8/9 Regression] ICE in compare_and_jump_seq at loop-unroll.c:838

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 19 09:27:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89768

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I can reproduce even with
--param max-unroll-times=70000 --param max-unrolled-insns=280000 -funroll-loops
-Ofast --param max-average-unrolled-insns=280000 -fno-tree-dominator-opts 
pr80565.c
--- gcc/loop-unroll.c.jj        2019-03-19 09:09:32.686006683 +0100
+++ gcc/loop-unroll.c   2019-03-19 10:15:50.319343904 +0100
@@ -652,7 +652,7 @@ unroll_loop_constant_iterations (struct
   if (loop->any_likely_upper_bound)
     loop->nb_iterations_likely_upper_bound
       = wi::udiv_trunc (loop->nb_iterations_likely_upper_bound, max_unroll +
1);
-  desc->niter_expr = GEN_INT (desc->niter);
+  desc->niter_expr = gen_int_mode (desc->niter, desc->mode);

   /* Remove the edges.  */
   FOR_EACH_VEC_ELT (remove_edges, i, e)
@@ -1020,9 +1020,9 @@ unroll_loop_runtime_iterations (struct l
       preheader = split_edge (loop_preheader_edge (loop));
       /* Add in count of edge from switch block.  */
       preheader->count += iter_count;
-      branch_code = compare_and_jump_seq (copy_rtx (niter), GEN_INT (j), EQ,
-                                         block_label (preheader), p,
-                                         NULL);
+      branch_code = compare_and_jump_seq (copy_rtx (niter),
+                                         gen_int_mode (j, desc->mode), EQ,
+                                         block_label (preheader), p, NULL);

       /* We rely on the fact that the compare and jump cannot be optimized
out,
         and hence the cfg we create is correct.  */
fixes the ICE, still the testcase is not usable for the testsuite, seems it has
481318 basic blocks in the function and seems to spent like forever in
#0  0x0000000000bbf031 in et_splay (occ=0x2f8b4c8) at ../../gcc/et-forest.c:319
#1  0x0000000000bbfc2d in et_below (down=0x301e8f8, up=0x301eaa8) at
../../gcc/et-forest.c:718
#2  0x0000000000b181be in dominated_by_p (dir=CDI_DOMINATORS,
bb1=0x7fffea96e138, bb2=0x7fffea97f208) at ../../gcc/dominance.c:1126
#3  0x0000000000b1865a in prune_bbs_to_update_dominators (bbs=...,
conservative=true) at ../../gcc/dominance.c:1257
#4  0x0000000000b18c94 in iterate_fix_dominators (dir=CDI_DOMINATORS, bbs=...,
conservative=true) at ../../gcc/dominance.c:1464
#5  0x0000000000a7f150 in remove_path (e=<error reading variable: Cannot access
memory at address 0xa5a5a5a5a5a5a5f9>, 
    irred_invalidated=0x7fffffffce4f, loop_closed_ssa_invalidated=0x0) at
../../gcc/cfgloopmanip.c:412
#6  0x0000000000eab54e in unroll_loop_runtime_iterations (loop=0x7fffea953000)
at ../../gcc/loop-unroll.c:1110
#7  0x0000000000ea91f8 in unroll_loops (flags=1) at ../../gcc/loop-unroll.c:299


More information about the Gcc-bugs mailing list