This is the mail archive of the mailing list for the libstdc++ 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]

Re: [v3] Possible fix for PR 5730

jlquinn at optonline dot net writes:


| > Now, I realize the macro __FAST_MATH__ may not be defined with
| > definite value -- that is really sad.  
| Why not?  It's controlled by the compiler, and the compiler is linked to the v3 library.  So we should be able to dictate what it is set to, no?

Only if we want to break existing codes, something I would advise against
even if I don't like the current semantics. 

>From the doc:

  @item -ffast-math
  @opindex ffast-math
  Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
  @option{-fno-trapping-math}, @option{-ffinite-math-only} and @*

  This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.

Which means that something like

  #ifdef __FAST_MATH__
     // do spurious calculations
     // do something sensical

will break if we change the way __FAST_MATH is defined.

| > Then maybe we want to add this to the config file
| > 
| > #ifdef __FAST_MATH__
| > # define _GLIBCPP_FAST_MATH 1
| > #else
| > # define _GLIBCPP_FAST_MATH 0
| > #endif
| > 
| > and use _GLIBCPP_FAST_MATH. 
| I presume you mean c++config.h?


-- Gaby

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