https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99726
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And -flive-patching=inline-clone -mavx512f -O2 -floop-nest-optimize
-ftree-loop-vectorize -ftrapv -m32
is sufficient to trigger it.
I'm afraid I'm lost in what exactly the code wants to do.
dr_a.dr:
#(Data Ref:
# bb: 57
# stmt: _231 = a[_238][_242];
# ref: a[_238][_242];
# base_object: a;
# Access function 0: {(unsigned int) (_239 - graphite_IV.18_206) + 2, +,
4294967295}_6
# Access function 1: {((unsigned int) (graphite_IV.18_206 + _234) + e.6_19) +
4294967295, +, 1}_6
#)
dr_b.dr:
#(Data Ref:
# bb: 57
# stmt: a[_250][_254] = _243;
# ref: a[_250][_254];
# base_object: a;
# Access function 0: {(unsigned int) (_251 - graphite_IV.18_206) + 1, +,
4294967295}_6
# Access function 1: {(unsigned int) (graphite_IV.18_206 + _247) + e.6_19, +,
1}_6
#)
DR_STEP (dr_a.dr) == DR_STEP (dr_b.dr) == 4092, so it is not neg_step:
bool neg_step = tree_int_cst_compare (DR_STEP (dr_a.dr), size_zero_node) < 0;
/* Index must evaluate in the same direction as DR. */
gcc_assert (!neg_step || tree_int_cst_sign_bit (idx_step) == 1);
but this doesn't check anything if neg_step is false, rather than ensuring it
has the same direction.
And
offset_int abs_idx_step = offset_int::from (wi::to_wide (idx_step),
SIGNED);
if (neg_step)
abs_idx_step = -abs_idx_step;
offset_int::from will treat the unsigned int idx_step of -1U as -1 and the
asserts fail because it is not non-negative.