Hello, On the FreeBSD -CURRENT mailing lists a user of the upcoming FreeBSD release discovered a bug in the GCC that is shipped with the base system (4.2.0 20070514). This bug causes the amount of iterations in a loop to be limited to the range of an array used in a single part of the loop. When the size of the loop is increased (in the attached example, to 6 or higher) the problem disappears.
The issue is solved when compiling the application with -O1 or lower. -- Summary: Loop optimization limits range to size of array used inside loop Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: blocker Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ed at fxq dot nl GCC build triplet: amd64-undermydesk-freebsd GCC host triplet: amd64-undermydesk-freebsd GCC target triplet: amd64-undermydesk-freebsd http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32500