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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
The warning corresponds to the call below where the RANGE shows what it's based
on:

;;   basic block 10, loop depth 1, count 237404316 (estimated locally), maybe
hot
;;    prev block 9, next block 11, flags: (NEW, REACHABLE, VISITED)
;;    pred:       9 [80.5% (guessed)]  count:237404316 (estimated locally)
(TRUE_VALUE,EXECUTABLE)
  # RANGE [18446744071562067968, 18446744073709551615]
  _12 = (long unsigned intD.10) _5;
  # .MEM_39 = VDEF <.MEM_38>
  memcpyD.925 (_11, pretmp_90, _12);

Mixing signed and unsigned ints in computations involving sizes, especially in
LP64 where size_t is larger than int, tends to lead to excessive results that
might then end up either triggering warnings or lead to suboptimal code.  Using
unsigned integers (e.g., making sbuf's s_n and s_sz members unsigned) avoids
the warning and looks like also lets GCC emit better object code.

Reply via email to