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: complex vs. __builtin_cpow


Benjamin Kosnik <bkoz@redhat.com> writes:

| Gaby: 
| 
| Your new patch gives two new errors on x86/linux:
| 
| FAIL: 26_numerics/complex/13450.cc (test for excess errors)
| WARNING: 26_numerics/complex/13450.cc compilation failed to produce executable
| FAIL: 26_numerics/complex/pow.cc (test for excess errors)
| WARNING: 26_numerics/complex/pow.cc compilation failed to produce executable

Gloops, sorry for that.  How this error escaped by testing is
unexplained to me.

| A sample from the log file:
| 
| /mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include/complex: In function `std::complex<_Tp> std::log(conststd::complex<_Tp>&) [with _Tp = float]':
| /mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include/complex:891:   instantiated from `std::complex<_Tp> std::pow(conststd::complex<_Tp>&, const_Tp&) [with _Tp = float]'
| /mnt/hd/src/gcc/libstdc++-v3/testsuite/26_numerics/complex/13450.cc:36:   instantiated from `void test01_do(T, T) [with T = float]'
| /mnt/hd/src/gcc/libstdc++-v3/testsuite/26_numerics/complex/13450.cc:48:   instantiated from here
| /mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include/complex:739: error: no matching function for call to `__complex_log(const float __complex__&)'
| 
| Now, on line 736 of std_complex.h I see:
| 
|   /*
|   inline __complex__ float
|   __complex_log(__complex__ float __z) { return __builtin_clogf(__z); }
| 
|   inline __complex__ double
|   __complex_log(__complex__ double __z) { return __builtin_clog(__z); }
| 
|   inline __complex__ long double
|   __complex_log(const __complex__ long double& __z)
|   { return __builtin_clog(__z); } */
| 
| Is this supposed to be uncommented?

No, it is supposed to be in comment, awaiting for the resolution of
the "clog" issue I alluded to in message

   http://gcc.gnu.org/ml/libstdc++/2004-05/msg00236.html

ans follow-ups (and I still have to send you several examples).

Until we resolve that issue.  The line in the patch

  template<typename _Tp>
    inline complex<_Tp>
    log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); }

should really have been

  template<typename _Tp>
    inline complex<_Tp>
    log(const complex<_Tp>& __z) { return __complex_log(__z); }

without call to .__rep().

Sorry about that.

-- Gaby


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