This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/18178] Missed opportunity for removing bounds checking
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Oct 2004 14:15:42 -0000
- Subject: [Bug tree-optimization/18178] Missed opportunity for removing bounds checking
- References: <20041027140944.18178.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-27 14:15 -------
The tree level looks like after optimization:
t.f(int[]) (this, a)
{
int i;
int D.385;
unsigned int i.3;
int D.376;
<bb 0>:
D.376 = a->length;
if (D.376 <= 0) goto <L8>; else goto <L17>;
<L17>:;
i = 0;
<L1>:;
i.3 = (unsigned int) i;
if ((unsigned int) D.376 > i.3) goto <L5>; else goto <L2>;
<L2>:;
D.385 = _Jv_ThrowBadArrayIndex (i);
<L5>:;
*(&a->data[0] + (int *) i.3 * 4B) = 0;
;
i = (int) (i.3 + 1);
D.376 = a->length;
if (i >= D.376) goto <L8>; else goto <L1>;
<L8>:;
return;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18178