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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
openmp expansion introduces this, not sure why we don't verify after that.

  v3 = 10;
  v2 = v2 + 18446744073709551613;
  if ((signed long) v2 < 0)

looks like failed re(?)-gimplification.  The condition is built from

#0  0x000000000349fde6 in extract_omp_for_update_vars (fd=0x7fffffffd830, 
    nonrect_bounds=0x0, cont_bb=<basic_block 0x7ffff6619240 (4)>, 
    body_bb=<basic_block 0x7ffff6619240 (4)>)
    at ../../src/gcc/gcc/omp-expand.cc:3286
#1  0x00000000034b16d0 in expand_omp_for_static_chunk (region=0x4a671f0, 
    fd=0x7fffffffd830, inner_stmt=<gimple 0x0>)
    at ../../src/gcc/gcc/omp-expand.cc:6253
#2  0x00000000034bd227 in expand_omp_for (region=0x4a671f0, 
    inner_stmt=<gimple 0x0>) at ../../src/gcc/gcc/omp-expand.cc:8267

3286              t = fold_build2 (fd->loops[i].cond_code, boolean_type_node,
v, t);
3287              stmt = gimple_build_cond_empty (t);

where the latter function doesn't seem to be able to deal with this kind
of folded condition (the plain condition w/o folding would have been OK).

we do

3289              if (walk_tree (gimple_cond_lhs_ptr (as_a <gcond *> (stmt)),
3290                             expand_omp_regimplify_p, NULL, NULL)
3291                  || walk_tree (gimple_cond_rhs_ptr (as_a <gcond *>
(stmt)),
3292                                expand_omp_regimplify_p, NULL, NULL))
3293                gimple_regimplify_operands (stmt, &gsi);

but expand_omp_regimplify_p is oddly simplistic, so maybe we were not supposed
to end up with a conversion in one of the operands.

Leaving to Jakub.

Reply via email to