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

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

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

--- Comment #1 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
This is because 'i' is int while 'base' is size_t. Loop init expression 'int i
= base' truncates base to 32 bits, and loop condition first converts i to
size_t and then compares in that unsigned type. It's not exactly obvious how
many iterations this loop has :)

Using the proper type for 'i' results in reasonable code.

Perhaps in principle niter analysis could handle this anyway?

Reply via email to