This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

middle-end/2827: invalid narrowing during use of double type, arrithametic becomes non-comutative



>Number:         2827
>Category:       middle-end
>Synopsis:       invalid narrowing during use of double type, arrithametic becomes non-comutative
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Tue May 15 09:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Rob Rescorla
>Release:        gcc version egcs-2.91.66 19990314/Liunx (egcs-1.1.2 release)
>Organization:
>Environment:
Redhat Linux 6.2 PII and PIII Intel,
gcc2.8.1 on sparc-sun-solaris2.6 did not demonstrate this behaviour.
>Description:
GCC appears to narrow double to float precision, desptie all
variables involved in a calculation being cast as double.
(Found attempting numerical integration.)

Alternative front ends (CC and G++) also tried, same results.
>How-To-Repeat:
compile the attached program and run.
N.B. running with optomisation causes both subtractions to
produce bad results.

>Fix:
None, re-writing code to force correct compilation was unsuccessfull.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-unknown-content-type-PFE32; name="doublediv.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="doublediv.c"

Ly92ZXJ5IHNpbXBsZSBkZW1vbnN0cmF0aW9uIG9mIGJ1ZywKLy9maXJzdCB0d28gbGluZXMgc2hv
dWxkIGJlIGlkZW50aWNhbCwgc2Vjb25kIHR3byBsaW5lcyBzaG91bGQgYmUKLy96ZXJvIHdoZW4g
Y29kZSBpcyBidWcgZnJlZSBjb21waWxlZC4KCiNpbmNsdWRlIDxzdGRpby5oPgojaW5jbHVkZSA8
bWF0aC5oPgppbnQgbWFpbih2b2lkKQp7CmRvdWJsZSBmLHEsaTsKcT0wLjQ7aT1zcXJ0KDIqTV9Q
SSk7CnByaW50ZigiJTAuODBsZlxuJTAuODBsZlxuIixxL2kscS9zcXJ0KDIqTV9QSSkpOyAKICBw
cmludGYoIiUwLjgwbGZcbiIsKCgoZG91YmxlKShxL3NxcnQoMipNX1BJKSkpLSgoZG91YmxlKShx
L2kpKSkpOwogIHByaW50ZigiJTAuODBsZlxuIiwoKChkb3VibGUpKHEvaSkpLSgoZG91YmxlKShx
L3NxcnQoMipNX1BJKSkpKSk7CnJldHVybigwKTsKfQo=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]