[Bug tree-optimization/84859] [8 Regression] bogus -Warray-bounds on a memcpy in a loop

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 14 17:16:00 GMT 2018


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

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
The warning is in response to the call to memcpy(d, s, 255) in h():

  <bb 8> [local count: 477815112]:
  a[0] = 255;
  __builtin_memcpy (&a, p_15(D), 255);
  _26 = a[0];

The wording seems clear:  The function is forming an offset that is out of the
bounds of the referenced object.

The range of the out-of-bounds offset is [9, 255], while the bounds of the
object are [0, 8].

If you think you have of a better/clearer way to phrase it then please propose
it.


More information about the Gcc-bugs mailing list