https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128945
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu.org
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
<bb 2> [local count: 1073741824]:
_13 = (sizetype) k_6(D);
_14 = _13 * 512;
_15 = _14 + 8;
p_7 = s_5(D) + _15;
r_9 = s_5(D)->rc.range;
_1 = (long unsigned int) i_10(D);
_2 = _1 * 2;
_3 = p_7 + _2;
*_3 = 1;
_4 = s_5(D)->rc.range;
_12 = r_9 - _4;
return _12;
we are not unleashing full data reference analysis on *_3 during
value-numbering, we'd have to conclude that 8 + k * 512 + 2 * i is never zero
and
in particular bigger than 3 or less than -3. But with k == 0 and i == -4U
it is zero. Specifically -fno-strict-aliasing would allow forming
a pointer to s->rc.range from the pointer to s->probs[k] so I think this
bug is invalid, at least as far as the code generated for an isolated
function 'f1' is concerned. For 'f2' we can at least see i is in [1, 255]
and I do not see any re-load of s->rc.range.
I'm quite sure the kernel relies on such pointer forming, IIRC at least for
up-casting, and kernel folks refuse to properly go through integer types in
such
cases. So much for wanting your own C dialect.