This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/79929] [7 Regression] Bogus Warning: '__builtin_memset': specified size 4294967291 exceeds maximum object size 2147483647


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Well, with -O1 one asks only for cheap optimizations, so the question is if a
warning that relies on more optimizations as this should be enabled at -O1.

We have:
  p_18 = c_17(D) + 5;
...
  if (p_18 < c_17(D))
    goto <bb 3>; [0.00%]
  else
    goto <bb 4>; [0.00%]

  <bb 3> [0.00%]:
  c.2_7 = (long int) c_17(D);
  p.3_8 = (long int) p_18;
  _9 = c.2_7 - p.3_8;
  _10 = (long unsigned int) _9;
  _11 = n_16 + 5;
  __builtin_memset (_11, 32, _10);

and cpp1 pass manages to fold the _10 into the huge value, but doesn't
similarly fold the pointer comparison.  So either we should not do that at -O1,
or should also be able to fold (A + cst) < A for pointer type A into cst < 0
(only if POINTER_TYPE_OVERFLOW_UNDEFINED ?).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]