This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/22348] New: Execution continues past end of for loop end condition with optimisation enabled
- From: "matt+gccbugs at ucc dot asn dot au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jul 2005 16:58:02 -0000
- Subject: [Bug c/22348] New: Execution continues past end of for loop end condition with optimisation enabled
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In a for loop with multiple variables, the end condition is not respected, execution continues past the end
condition.
The small attached sample code runs fine with -O0 or with gcc-3.3, but fails with -O1, -Os, -O2 or -O3
with gcc-4.0. Execution continues past the end of the loop, resulting in a segfault (buffer overflow).
Versions tested include
gcc version 4.0.1 20050522 (prerelease) (Debian 4.0.0-9)
and
gcc version 4.0.1 20050701 (prerelease) (Debian 4.0.0-12ubuntu2)
--
Summary: Execution continues past end of for loop end condition
with optimisation enabled
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: matt+gccbugs at ucc dot asn dot au
CC: gcc-bugs at gcc dot gnu dot org
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=22348