The source here generates an asserion failure compiled with anything above -O0. Changing p+1 to p seems to avoid the bug. The infinite loops are not a feature of the original code but the uderlying problem appears to be indentical.
"screenshot" [EMAIL PROTECTED]:~/duncan/src/foo/wlocal/build/phone/mq$ gcc --version gcc (GCC) 4.2.0 20051217 (experimental) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [EMAIL PROTECTED]:~/duncan/src/foo/wlocal/build/phone/mq$ gcc --version gcc (GCC) 4.2.0 20051217 (experimental) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [EMAIL PROTECTED]:~/duncan/src/foo/wlocal/build/phone/mq$ gcc -g -O2 -o /tmp/foo.o /tmp/foo.c /tmp/foo.c: In function 'foo': /tmp/foo.c:32: internal compiler error: in handle_ptr_arith, at tree-ssa-structalias.c:3188 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. -- Summary: Assertion failure in pointer analysis Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dps at simpson dot demon dot co dot uk GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25488