This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Simple value range propagation for tree-ssa-dom
- From: Andrew Haley <aph at redhat dot com>
- To: law at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 1 Oct 2003 12:09:35 +0100
- Subject: [tree-ssa] Simple value range propagation for tree-ssa-dom
- References: <200309301719.h8UHJhpW029478@speedy.slc.redhat.com>
I was hoping that this would cause redundant checks like this to be
removed:
int a[10];
int foo ()
{
int j;
int m=0;
for (j=0; j<10;j++)
{
if (j < 0)
abort();
if (j > 10)
abort();
m+=a[j];
}
return m;
}
But it doesn't seem to work:
foo:
subl $12, %esp
xorl %eax, %eax
xorl %edx, %edx
.p2align 4,,15
.L3:
testl %edx, %edx
js .L9
movl a(,%edx,4), %ecx
incl %edx
addl %ecx, %eax
cmpl $9, %edx
jle .L3
addl $12, %esp
ret
.L9:
call abort
Andrew.