public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: ac@m2000.fr To: gcc-gnats@gcc.gnu.org Subject: optimization/10078: bad code generated with optimisation. Date: Fri, 14 Mar 2003 10:56:00 -0000 [thread overview] Message-ID: <20030314105048.15146.qmail@sources.redhat.com> (raw) >Number: 10078 >Category: optimization >Synopsis: bad code generated with optimisation. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Fri Mar 14 10:56:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: ac@m2000.fr >Release: gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7) >Organization: >Environment: Linux machine 2.4.18-14smp #1 SMP Wed Sep 4 11:55:37 EDT 2002 i686 athlon i386 GNU/Linux >Description: When compiled with -O or -O2, this program return the last greatest value intead of the first... >How-To-Repeat: When compiled with 'gcc -Wall bug-20030313.c' you get the correct result (return == 0), when compiled with 'gcc -Wall -O2 bug-20030313.c' you get the wrong result (return != 0). >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="bug-20030313.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bug-20030313.c" CnN0YXRpYyBkb3VibGUgb2dmKGludCBtLCBpbnQgZCkKewoJcmV0dXJuIG0gJSAxMCArIGQgJSA0 ICogMC4xOwp9CgpzdGF0aWMgZG91YmxlIGNnZihpbnQgbSwgaW50IGQpCnsKCXJldHVybiBtICUg NSArIGQgJSAyICogMC4xOwp9CgppbnQgbWFpbigpCnsKCWludCBtLCBibSA9IC0xOwoJaW50IGQs IGJkID0gLTE7Cglkb3VibGUgb2csIGJvZyA9IC0xLjA7Cglkb3VibGUgY2csIGJjZyA9IC0xLjA7 CgoJZm9yIChtID0gMDsgbSAhPSAyMDsgKyttKSB7CgkJZm9yIChkID0gMDsgZCA8IDg7ICsrZCkg ewoJCQlvZyA9IG9nZihtLCBkKTsgCgkJCWNnID0gY2dmKG0sIGQpOwoJCQlpZiAob2cgPiBib2cp IHsKCQkJCWJvZyA9IG9nOyBiY2cgPSBjZzsgYm0gPSBtOyBiZCA9IGQ7CgkJCX0gZWxzZSBpZiAo b2cgPT0gYm9nICYmIGNnID4gYmNnKSB7CgkJCQliY2cgPSBjZzsgYm0gPSBtOyBiZCA9IGQ7CgkJ CX0KCQl9Cgl9CgoJcmV0dXJuIGJtICE9IDkgfHwgYmQgIT0gMzsKfQo=
next reply other threads:[~2003-03-14 10:56 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-03-14 10:56 ac [this message] 2003-03-14 11:32 ebotcazou
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=20030314105048.15146.qmail@sources.redhat.com \ --to=ac@m2000.fr \ --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).