public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: andrej.filipcic@ijs.si To: gcc-gnats@gcc.gnu.org Subject: c++/9062: gcc 3.2.0, 3.2.1 optimization bug with postincrement Date: Thu, 26 Dec 2002 16:56:00 -0000 [thread overview] Message-ID: <20021227004649.10629.qmail@sources.redhat.com> (raw) >Number: 9062 >Category: c++ >Synopsis: gcc 3.2.0, 3.2.1 optimization bug with postincrement >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Dec 26 16:56:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: andrej.filipcic@ijs.si >Release: unknown-1.0 >Organization: >Environment: redhat 8.0 >Description: The following code miscompiles with "g++ -O2" gcc-3.2.0, gcc-3.2.1. "-O0,1,3" gives correct results. Output of "-O2" is "bcdefgh" instead of "abcdefgh" Equivalent in c only works with "-O1". ---------------------- #include <iostream> using namespace std; void str2lower(char *p) { while(*p) *p++=tolower(*p); } int main() { char str[]="Abcdefgh"; str2lower(str); cout<<str<<endl; } >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2002-12-27 0:56 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-12-26 16:56 andrej.filipcic [this message] 2002-12-30 13:29 reichelt
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=20021227004649.10629.qmail@sources.redhat.com \ --to=andrej.filipcic@ijs.si \ --cc=gcc-gnats@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: linkBe 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).