lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Let's keep the focus on Lua, please.

On Mon, Dec 7, 2020 at 9:42 AM Ranier Vilela <> wrote:
Em seg., 7 de dez. de 2020 às 09:30, Viacheslav Usov <> escreveu:
On Mon, Dec 7, 2020 at 1:16 PM Ranier Vilela <> wrote:

> It seems to me that someone forgot to apply the same optimization for "unsigned int", into gcc code.

The same optimization does not exist for unsigned int, because it is
only made possible by the undefined behavior of the signed int
But with a code that programmer knows that not overflow:
x86-64 gcc 10.2 (-O2)
unsigned int f(unsigned int i) { unsigned int j, k = 0; for (j = i; j < i; ++j) ++k; return k; }
f(unsigned int):
        xor     eax, eax

Ranier Vilela