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

2016-03-10 Thread Jason Ekstrand
On Mar 10, 2016 1:21 PM, "Eirik Byrkjeflot Anonsen" wrote: > > Ian Romanick writes: > > > From: Ian Romanick > > > > 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 t

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

2016-03-10 Thread Eirik Byrkjeflot Anonsen
Ian Romanick writes: > From: Ian Romanick > > 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

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

2016-03-10 Thread Ian Romanick
From: Ian Romanick I don't understand why the old code was bad, but the new code is fine. brw_state_dump.c: In function ‘brw_debug_batch’: brw_state_dump.c:677:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] for (i = 0; i < size / 4; i += 4) {