[Mesa-dev] [PATCH 03/10] i965: Silence loop counter overflow warning

Eirik Byrkjeflot Anonsen eirik at eirikba.org
Thu Mar 10 21:11:14 UTC 2016


Ian Romanick <idr at freedesktop.org> writes:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> I don't understand why the old code was bad, but the new code is fine.

Probably because the *loop counter* can no longer overflow. Thus the
loop can be optimized. The fact that "i" might overflow has become
irrelevant to the warning.

(And from that perspective, it isn't equivalent. If "i" overflows in the
original code, you would get an infinite loop.)

eirik


More information about the mesa-dev mailing list