public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/10078: bad code generated with optimisation.
@ 2003-03-14 11:32 ebotcazou
  0 siblings, 0 replies; 2+ messages in thread
From: ebotcazou @ 2003-03-14 11:32 UTC (permalink / raw)
  To: ac, gcc-bugs, gcc-prs, nobody

Synopsis: bad code generated with optimisation.

State-Changed-From-To: open->closed
State-Changed-By: ebotcazou
State-Changed-When: Fri Mar 14 11:32:55 2003
State-Changed-Why:
    Not a bug. On x86, when optimizing, floating point values
    may be kept in FP registers when doing comparison with
    others stored in memory. Now x86 FP registers have
    extra-precision over a 'double', which may invalid
    an equality comparison. Compile your code with '-ffloat-store'
    if it relies on exact IEEE floating-point semantics.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10078


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

* optimization/10078: bad code generated with optimisation.
@ 2003-03-14 10:56 ac
  0 siblings, 0 replies; 2+ messages in thread
From: ac @ 2003-03-14 10:56 UTC (permalink / raw)
  To: gcc-gnats


>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=


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

end of thread, other threads:[~2003-03-14 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-14 11:32 optimization/10078: bad code generated with optimisation ebotcazou
  -- strict thread matches above, loose matches on Subject: below --
2003-03-14 10:56 ac

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).