public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "matt+gccbugs at ucc dot asn dot au" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/22348] New: Execution continues past end of for loop end condition with optimisation enabled
Date: Thu, 07 Jul 2005 16:58:00 -0000	[thread overview]
Message-ID: <20050707165800.22348.matt+gccbugs@ucc.asn.au> (raw)

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


             reply	other threads:[~2005-07-07 16:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-07 16:58 matt+gccbugs at ucc dot asn dot au [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050707165800.22348.matt+gccbugs@ucc.asn.au \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).