public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/22348] New: Execution continues past end of for loop end condition with optimisation enabled
@ 2005-07-07 16:58 matt+gccbugs at ucc dot asn dot au
  2005-07-07 16:59 ` [Bug c/22348] " matt+gccbugs at ucc dot asn dot au
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: matt+gccbugs at ucc dot asn dot au @ 2005-07-07 16:58 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2005-09-08 12:38 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-07 16:58 [Bug c/22348] New: Execution continues past end of for loop end condition with optimisation enabled matt+gccbugs at ucc dot asn dot au
2005-07-07 16:59 ` [Bug c/22348] " matt+gccbugs at ucc dot asn dot au
2005-07-07 17:02 ` matt+gccbugs at ucc dot asn dot au
2005-07-07 17:13 ` [Bug tree-optimization/22348] [4.0 Regression] " pinskia at gcc dot gnu dot org
2005-07-07 17:39 ` [Bug tree-optimization/22348] [4.0/4.1 " pinskia at gcc dot gnu dot org
2005-07-14 20:36 ` [Bug tree-optimization/22348] [4.0/4.1 Regression] IV canonicalization causes execution of loops past their end condition steven at gcc dot gnu dot org
2005-07-14 23:46 ` steven at gcc dot gnu dot org
2005-07-15  0:06 ` steven at gcc dot gnu dot org
2005-07-15  9:58 ` rakdver at gcc dot gnu dot org
2005-07-15 10:26 ` rakdver at gcc dot gnu dot org
2005-07-27 14:06 ` cvs-commit at gcc dot gnu dot org
2005-07-27 14:27 ` [Bug tree-optimization/22348] [4.0/4.1 Regression] Wrong folding for FLOOR_MOD_EXPR rakdver at gcc dot gnu dot org
2005-07-27 16:37 ` pinskia at gcc dot gnu dot org
2005-07-27 16:39 ` [Bug tree-optimization/22348] [4.0/4.1 Regression] Execution continues past end of for loop end condition with optimisation enabled pinskia at gcc dot gnu dot org
2005-07-27 16:40 ` [Bug tree-optimization/22348] [4.0 " pinskia at gcc dot gnu dot org
2005-07-27 16:45 ` pinskia at gcc dot gnu dot org
2005-08-29 14:58 ` bonzini at gcc dot gnu dot org
2005-08-29 15:26 ` rakdver at gcc dot gnu dot org
2005-09-01 16:09 ` cvs-commit at gcc dot gnu dot org
2005-09-08 10:09 ` cvs-commit at gcc dot gnu dot org
2005-09-08 12:38 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).