This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78249] New: In consistent results for 0.0 * inf when optimizer is enabled
- From: "joshua.england at worldprogramming dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 08 Nov 2016 09:47:31 +0000
- Subject: [Bug c++/78249] New: In consistent results for 0.0 * inf when optimizer is enabled
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78249
Bug ID: 78249
Summary: In consistent results for 0.0 * inf when optimizer is
enabled
Product: gcc
Version: 6.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: joshua.england at worldprogramming dot com
Target Milestone: ---
Created attachment 39988
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39988&action=edit
Code and make file to show the bug
The following code gives -NAN when not optimized and NAN when optimized (note
the change in sign).
double x = 0.0 * std::numeric_limits<double>::infinity();
The attachment contains FORTRAN code as the project I am working on requires
linking to FORTRAN code. I discovered the problem because of inconsistent
results between the output from GFORTRAN and G++ give similar code.