This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/18784] New: Floating point calculation inconsistent within program with -O2
- From: "Graham dot Murphy at jhuapl dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Dec 2004 14:19:01 -0000
- Subject: [Bug c/18784] New: Floating point calculation inconsistent within program with -O2
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Attached (hopefully) is a C program that performs a simple
floating point calculation that produces a number very close
to an integer. When this calculation is done twice within
the same program, two different answers are produced if
there is an intervening print statement and -O2 or greater
optimization.
Problem appears with gcc 2.9 through 3.4.2 and Pentiums 1 - 4.
Not seen on AMD or Sparcs.
I have examined the FPU IEEE rounding control bits but see no
difference between the two sections.
--
Summary: Floating point calculation inconsistent within program
with -O2
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Graham dot Murphy at jhuapl dot edu
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux
GCC host triplet: i686-pc-linux
GCC target triplet: i686-pc-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18784