From e01b452d338ef5fd7d31bcd16ff9efb9ee77aa6d Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Wed, 5 May 2004 00:13:13 +0000 Subject: [PATCH] Intel compiler: removed unnecessary protections against the __GNUG__ macro The problem was in IA_force_to_double --- Packages/Interval_arithmetic/changes.txt | 9 +++++++++ Packages/Interval_arithmetic/include/CGAL/FPU.h | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Packages/Interval_arithmetic/changes.txt b/Packages/Interval_arithmetic/changes.txt index aee374001bc..cffd0459d10 100644 --- a/Packages/Interval_arithmetic/changes.txt +++ b/Packages/Interval_arithmetic/changes.txt @@ -1,3 +1,12 @@ +4 May 2004: Menelaos Karavelas +- previous date because of time difference. +- continuation of changes made by Sylvain in FPU.h for supporting the + Intel compiler on Linux. + The problem with the Intel compiler was in IA_force_to_double. + Made the following changes: + 1. removed all irrelevant checks for the Intel compiler + 2. added comment in IA_force_to_double about the Intel compiler + 5 May 2004 Sylvain Pion - ICC is defining __GNUG__ by default on Linux. Protect against it with !defined __INTEL_COMPILER. diff --git a/Packages/Interval_arithmetic/include/CGAL/FPU.h b/Packages/Interval_arithmetic/include/CGAL/FPU.h index e761682f8c0..63c6f3e1302 100644 --- a/Packages/Interval_arithmetic/include/CGAL/FPU.h +++ b/Packages/Interval_arithmetic/include/CGAL/FPU.h @@ -40,7 +40,7 @@ extern "C" { #elif defined __SUNPRO_CC || (defined __KCC && defined __sun) # include #elif defined __osf || defined __osf__ -# ifdef __GNUG__ && !defined __INTEL_COMPILER +# ifdef __GNUG__ // GCC seems to remove (fixincludes) read_rnd/write_rnd... # include "/usr/include/float.h" # else @@ -101,6 +101,10 @@ inline double IA_force_to_double(double x) ! (__GNUG__ == 3 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0) // This appears to be faster but is GNU specific, // and GCC 3.0.0 has a bug with it. + // Menelaos: this is the place where interval arithmetic fails + // for the Intel compiler in linux; the Intel compiler + // defines by default __GNUG__ and the following code is + // compiled instead of the one after the #else. asm("" : "=m"(x) : "m"(x)); // asm("" : "+m"(x) ); return x; @@ -127,7 +131,7 @@ inline double IA_force_to_double(double x) // because operations are done with a wrong rounding mode at compile time. // G++ also uses __builtin_constant_p(). #ifndef CGAL_IA_DONT_STOP_CONSTANT_PROPAGATION -# if defined __GNUG__ && __GNUG__ < 3 && !defined __INTEL_COMPILER +# if defined __GNUG__ && __GNUG__ < 3 // Note : GCC 3 doesn't guarantee __builtin_constant_p to return false // when he will not do cprop :(. # define CGAL_IA_STOP_CPROP(x) \