[Bug tree-optimization/101105] [11/12 Regression] wrong code at -O3 on x86_64-linux-gnu
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jun 23 09:37:23 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101105
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So what happens is that vect_compile_time_alias fails to perform the offset
adjustment for the negative step DR
#(Data Ref:
# bb: 3
# stmt: b[g_40][0] = 0;
# ref: b[g_40][0];
# base_object: b;
# Access function 0: 0
# Access function 1: {3, +, -1}_1
which is done via
/* For negative step, we need to adjust address range by TYPE_SIZE_UNIT
bytes, e.g., int a[3] -> a[1] range is [a+4, a+16) instead of
[a, a+12) */
if (tree_int_cst_compare (DR_STEP (a->dr), size_zero_node) < 0)
{
const_length_a = (-wi::to_poly_wide (segment_length_a)).force_uhwi ();
offset_a -= const_length_a;
}
since we zero segment_length_a because of ignore_step_p. But that adjustment
cannot be ignored. I suppose we need to track a separate "offset segment
length"
for this purpose?
More information about the Gcc-bugs
mailing list