This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/36124] conditional loop becomes infinite loop in -O2 (gcc 4.2 -> 4.3 regression)
- From: "cyprien+gccbug at cypou dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 May 2008 17:03:39 -0000
- Subject: [Bug middle-end/36124] conditional loop becomes infinite loop in -O2 (gcc 4.2 -> 4.3 regression)
- References: <bug-36124-16149@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from cyprien+gccbug at cypou dot net 2008-05-04 17:03 -------
Now, this code should not rely on undefined behaviour:
extern void func(int,void*);
void test()
{
register long *foo = (long*) (4*sizeof(*foo)) - 1;
register int index;
for(index=0;index<4;index++)
func(index,foo--);
}
it still make an infinite loop, while last func call is done with foo parameter
(nil).
Do you mean I explicitely ask gcc to use foo as end-of-loop condition ??
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36124