This is the mail archive of the libstdc++@gcc.gnu.org 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


Phil Edwards writes:
 > On Wed, Mar 19, 2003 at 09:09:15AM -0500, Jerry Quinn wrote:
 > > I just tried the test case comparing gcc 2.95 and 3.3 branch.  The gap is now
 > > smaller than the reporter saw, but it is there:
 > > 
 > > gcc 2.95     1.2s
 > > gcc 3.3	     1.6s

 > Here's your idea plus Gaby's responses turned into code.  Does this give
 > any better answers on the test case?  (For some reason I no longer have
 > 2.95 installed.  I need to go find out why, and reinstall it.)

The patch below is basically identical to the one I did this morning
and was going to send in.  With this change in place, gcc 3.3 will get
1.1s when --fast-math is set.

I think this is sufficient to close the bug.  What do you think?

Jerry




 > Index: bits/c++config
 > ===================================================================
 > retrieving revision 1.671
 > diff -u -3 -r1.671 c++config
 > --- bits/c++config      20 Mar 2003 00:17:13 -0000      1.671
 > +++ bits/c++config      20 Mar 2003 22:56:32 -0000
 > @@ -90,4 +90,11 @@
 >  // The remainder of the prewritten config is mostly automatic; all the
 >  // user hooks are listed above.
 > 
 > +// See std_complex.h for how this is used.
 > +#ifdef __FAST_MATH__
 > +# define _GLIBCPP_FAST_MATH 1
 > +#else
 > +# define _GLIBCPP_FAST_MATH 0
 > +#endif
 > +
 >  // End of prewritten config; the discovered settings follow.
 > Index: std/std_complex.h
 > ===================================================================
 > retrieving revision 1.4
 > diff -u -3 -r1.4 std_complex.h
 > --- std/std_complex.h   16 Dec 2002 18:22:59 -0000      1.4
 > +++ std/std_complex.h   20 Mar 2003 22:54:56 -0000
 > @@ -456,7 +456,8 @@
 >      inline _Tp
 >      norm(const complex<_Tp>& __z)
 >      {
 > -      return _Norm_helper<__is_floating<_Tp>::_M_type>::_S_do_it(__z);
 > +      return _Norm_helper<_GLIBCPP_FAST_MATH || __is_floating<_Tp>::_M_type>
 > +               ::_S_do_it(__z);
 >      }
 > 
 >    template<typename _Tp>
 > 


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