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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |11.0, 9.3.0
     Ever confirmed|0                           |1
                 CC|                            |msebor at gcc dot gnu.org
   Last reconfirmed|                            |2020-09-14
      Known to fail|                            |10.2.0
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed with GCC 10.  Trunk doesn't show the warning because it doesn't
synthesize the invalid memmove call.

The warning is issued on the basis of the memmove call in IL below.  The
constant 4294967288 is too large to represent a valid size of an object in
ILP32.  The -Warray-bounds warning complains about the same thing (that the
result of adding the offset into the object to the size isn't a valid pointer).

  <bb 36> [local count: 714496489]:
  _44 = MEM[(const struct InlineStorage *)&testArray]._capacity;
  if (_44 != 1)
    goto <bb 21>; [66.00%]
  else
    goto <bb 37>; [34.00%]

  <bb 37> [local count: 242928809]:
  _135 = (unsigned int) &MEM <union aligned_storage_t> [(void *)&testArray];
  _37 = (unsigned int) &MEM[(struct InlineStorage *)&testArray]._union;
  _46 = _37 - _135;
  _102 = &MEM <union aligned_storage_t> [(void *)&testArray + 8B] + _46;
  _31 = &MEM <union aligned_storage_t> [(void *)&testArray] + _46;
  __builtin_memmove (_102, _31, 4294967288);
  MEM[(int *)&testArray + 8B] = 6;
  pos_32 = &MEM[(struct InlineStorage *)&testArray]._union + 4;
  goto <bb 24>; [100.00%]

Reply via email to