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]
Other format: [Raw text]

[Bug target/14850] New: -ffloat-store and -mieee-fp aren't doing what I assume they should do


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


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