On Thu, 24 Apr 2014, Jeff Law wrote:
On 04/24/14 06:40, Agustin Perez Paladini wrote:
int
fun_module(int a)
{
ASSUME(a % 4 == 0);
if (a == 3) {
return 123;
}
return 789;
}
giving this asm
fun_module:
.LFB3:
.cfi_startproc
cmpl $3, 4(%esp)
movl $789, %edx
movl $123, %eax
cmovne %edx, %eax
ret
.cfi_endproc
Anyway, I think its pretty much what I was looking for.
Feel free to file a bug report for this one. VRP doesn't have a nonzero/zero
bits tracking lattice, but it's something I can see being added at some point
and having examples like this in the BZ database is often helpful when doing
that kind of optimization work.
gcc-4.9 (CCP3) already optimizes this testcase ;-)
--
Marc Glisse