This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/14850] New: -ffloat-store and -mieee-fp aren't doing what I assume they should do
- From: "gonnetp at inf dot ethz dot ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Apr 2004 11:11:17 -0000
- Subject: [Bug target/14850] New: -ffloat-store and -mieee-fp aren't doing what I assume they should do
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I am trying to compute the IEEE-754 unit of least precision (ulp) for 64-bit
double precision numbers on an IA-32 machine with the following C-code:
int main ( int argc , char *argv ) {
double d, eps;
printf("Unit of Least Precision:\n");
d = 1.0; eps = 0.5;
while (1.0 + eps/2 > 1.0)
eps /= 2;
printf("ulp = %20.16e\n\n",eps);
}
Compiling with gcc-3.3.1 using
gcc -O0 -ffloat-store -mieee-fp ieee.c
I get the output
Unit of Least Precision:
ulp = 1.0842021724855044e-19
meaning that my program is using the extra bits despite the "-ffloat-store" and
"-mieee-fp" options. Is this correct?
Using the Intel C Compiler v. 7.1 and compiling with
icc -pc64 -O0 ieee.c
I get the correct result
Unit of Least Precision:
ulp = 2.2204460492503131e-16
Is there an option to gcc that forces the use of IEEE-754 64-bit operations as
in the Intel compiler? If not, is there any way to set this behaviour by hand?
Cheers and thanks
Pedro
--
Summary: -ffloat-store and -mieee-fp aren't doing what I assume
they should do
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gonnetp at inf dot ethz dot ch
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14850