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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is in IVOPTs:

#13 0x00000000011ed370 in create_iv (base=<nop_expr 0x7ffff6a6ce20>, 
    step=<nop_expr 0x7ffff6a6ce40>, var=<var_decl 0x7ffff6a6d630 ivtmp.21>, 
    loop=0x7ffff6a4d620, incr_pos=0x7fffffffd880, after=true, 
    var_before=0x2523a20, var_after=0x2523a28)
    at /space/rguenther/tramp3d/trunk/gcc/tree-ssa-loop-manip.c:147
147       step = force_gimple_operand (step, &stmts, true, NULL_TREE);
(gdb) l
142             step = fold_build1 (NEGATE_EXPR, TREE_TYPE (step), step);
143           incr_op = POINTER_PLUS_EXPR;
144         }
145       /* Gimplify the step if necessary.  We put the computations in front
of the
146          loop (i.e. the step should be loop invariant).  */
147       step = force_gimple_operand (step, &stmts, true, NULL_TREE);
148       if (stmts)
149         gsi_insert_seq_on_edge_immediate (pe, stmts);
150
151       stmt = gimple_build_assign (va, incr_op, vb, step);

ends up trying to gimplfy

(long unsigned int) ((if (_40 > 0)
  {
    iftmp.23 = _14 + 1;
  }
else
  {
    iftmp.23 = 1;
  }) * pretmp_43)

but we can't put GENERIC COND_EXPR into GIMPLE via force_gimple_operand ().
At least not iff it contains possibly trapping operations.

ISTR fixing up places to avoid gobbling up trapping expressions, so I'll have
a look (it's SCEV analysis).

Reply via email to