diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-09-27 09:27:05 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-09-27 09:27:05 +0000 |
commit | f3961bdf99769d7fb9ed66283a6520b519cc8773 (patch) | |
tree | e91a88e04ef45c0add337e06a9114ba5e687d471 /libstdc++-v3 | |
parent | 6300156042c8ea54f146abe9a7deb9c7ebdef655 (diff) | |
download | gcc-f3961bdf99769d7fb9ed66283a6520b519cc8773.zip gcc-f3961bdf99769d7fb9ed66283a6520b519cc8773.tar.gz gcc-f3961bdf99769d7fb9ed66283a6520b519cc8773.tar.bz2 |
cmath (__pow_helper): Remove.
2010-09-27 Paolo Carlini <paolo.carlini@oracle.com>
* include/c_std/cmath (__pow_helper): Remove.
(__cmath_power): Remove declaration.
* include/c_global/cmath: Likewise.
* include/std/complex (__complex_pow_unsigned): Add.
(pow(const complex<_Tp>&, int)): Use the latter.
* include/c_std/cmath.tcc: Remove file.
* include/c_global/cmath.tcc: Likewise.
* acinclude.m4: Adjust.
* include/Makefile.am: Likewise.
* configure: Regenerate.
* include/Makefile.in: Likewise.
From-SVN: r164645
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 14 | ||||
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 5 | ||||
-rwxr-xr-x | libstdc++-v3/configure | 36 | ||||
-rw-r--r-- | libstdc++-v3/include/Makefile.am | 15 | ||||
-rw-r--r-- | libstdc++-v3/include/Makefile.in | 13 | ||||
-rw-r--r-- | libstdc++-v3/include/c_global/cmath | 18 | ||||
-rw-r--r-- | libstdc++-v3/include/c_global/cmath.tcc | 55 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/cmath | 17 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/cmath.tcc | 55 | ||||
-rw-r--r-- | libstdc++-v3/include/std/complex | 22 |
10 files changed, 52 insertions, 198 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 021cb8c..42ea0b3 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,17 @@ +2010-09-27 Paolo Carlini <paolo.carlini@oracle.com> + + * include/c_std/cmath (__pow_helper): Remove. + (__cmath_power): Remove declaration. + * include/c_global/cmath: Likewise. + * include/std/complex (__complex_pow_unsigned): Add. + (pow(const complex<_Tp>&, int)): Use the latter. + * include/c_std/cmath.tcc: Remove file. + * include/c_global/cmath.tcc: Likewise. + * acinclude.m4: Adjust. + * include/Makefile.am: Likewise. + * configure: Regenerate. + * include/Makefile.in: Likewise. + 2010-09-22 David Krauss <potswa@mac.com> PR libstdc++/45628 diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 5c856ba..3b14f02 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1695,16 +1695,11 @@ AC_DEFUN([GLIBCXX_ENABLE_CHEADERS], [ c_compatibility=yes fi - if test $enable_cheaders = c_global || test $enable_cheaders = c_std; then - c_extra=yes - fi - AC_SUBST(C_INCLUDE_DIR) GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C, test $enable_cheaders = c) GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C_STD, test $enable_cheaders = c_std) GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C_GLOBAL, test $enable_cheaders = c_global) GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_COMPATIBILITY, test $c_compatibility = yes) - GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_EXTRA, test $c_extra = yes) ]) diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 0032823..166d2e3 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -649,8 +649,6 @@ ENABLE_PARALLEL_TRUE GLIBCXX_BUILD_DEBUG_FALSE GLIBCXX_BUILD_DEBUG_TRUE DEBUG_FLAGS -GLIBCXX_C_HEADERS_EXTRA_FALSE -GLIBCXX_C_HEADERS_EXTRA_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_C_GLOBAL_FALSE @@ -11468,7 +11466,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11471 "configure" +#line 11469 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11574,7 +11572,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11577 "configure" +#line 11575 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14914,7 +14912,7 @@ fi # # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. cat > conftest.$ac_ext << EOF -#line 14917 "configure" +#line 14915 "configure" struct S { ~S(); }; void bar(); void foo() @@ -15282,7 +15280,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } # Fake what AC_TRY_COMPILE does. cat > conftest.$ac_ext << EOF -#line 15285 "configure" +#line 15283 "configure" int main() { typedef bool atomic_type; @@ -15319,7 +15317,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15322 "configure" +#line 15320 "configure" int main() { typedef short atomic_type; @@ -15356,7 +15354,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15359 "configure" +#line 15357 "configure" int main() { // NB: _Atomic_word not necessarily int. @@ -15394,7 +15392,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15397 "configure" +#line 15395 "configure" int main() { typedef long long atomic_type; @@ -15470,7 +15468,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 15473 "configure" +#line 15471 "configure" int main() { _Decimal32 d1; @@ -16071,11 +16069,6 @@ $as_echo "$as_me: \"C\" header strategy set to $enable_cheaders" >&6;} c_compatibility=yes fi - if test $enable_cheaders = c_global || test $enable_cheaders = c_std; then - c_extra=yes - fi - - @@ -58987,15 +58980,6 @@ else fi - if test $c_extra = yes; then - GLIBCXX_C_HEADERS_EXTRA_TRUE= - GLIBCXX_C_HEADERS_EXTRA_FALSE='#' -else - GLIBCXX_C_HEADERS_EXTRA_TRUE='#' - GLIBCXX_C_HEADERS_EXTRA_FALSE= -fi - - if test $enable_libstdcxx_debug = yes; then GLIBCXX_BUILD_DEBUG_TRUE= GLIBCXX_BUILD_DEBUG_FALSE='#' @@ -59453,10 +59437,6 @@ if test -z "${GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE}" && test -z "${GLIBCXX_C_HEA as_fn_error "conditional \"GLIBCXX_C_HEADERS_COMPATIBILITY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${GLIBCXX_C_HEADERS_EXTRA_TRUE}" && test -z "${GLIBCXX_C_HEADERS_EXTRA_FALSE}"; then - as_fn_error "conditional \"GLIBCXX_C_HEADERS_EXTRA\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${GLIBCXX_BUILD_DEBUG_TRUE}" && test -z "${GLIBCXX_BUILD_DEBUG_FALSE}"; then as_fn_error "conditional \"GLIBCXX_BUILD_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 2fb3fd5..460e1ff 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -824,15 +824,8 @@ profile_impl_headers = \ ${profile_impl_srcdir}/profiler_list_to_vector.h \ ${profile_impl_srcdir}/profiler_list_to_slist.h -# Some of the different "C" header models need extra files. # Some "C" header schemes require the "C" compatibility headers. # For --enable-cheaders=c_std -if GLIBCXX_C_HEADERS_EXTRA -c_base_headers_extra = ${c_base_srcdir}/cmath.tcc -else -c_base_headers_extra = -endif - if GLIBCXX_C_HEADERS_COMPATIBILITY c_compatibility_headers_extra = ${c_compatibility_headers} else @@ -915,10 +908,10 @@ endif # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. allstamped = \ - stamp-std stamp-bits stamp-c_base stamp-c_base_extra \ - stamp-c_compatibility stamp-backward stamp-ext stamp-pb \ - stamp-tr1 stamp-tr1-impl stamp-decimal stamp-debug \ - stamp-parallel stamp-profile stamp-profile-impl stamp-host + stamp-std stamp-bits stamp-c_base stamp-c_compatibility \ + stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-tr1-impl \ + stamp-decimal stamp-debug stamp-parallel stamp-profile \ + stamp-profile-impl stamp-host # List of all files that are created by explicit building, editing, or # catenation. diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index d3adde5..f8a9718 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -1058,13 +1058,10 @@ profile_impl_headers = \ ${profile_impl_srcdir}/profiler_list_to_vector.h \ ${profile_impl_srcdir}/profiler_list_to_slist.h -@GLIBCXX_C_HEADERS_EXTRA_FALSE@c_base_headers_extra = +@GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@c_compatibility_headers_extra = -# Some of the different "C" header models need extra files. # Some "C" header schemes require the "C" compatibility headers. # For --enable-cheaders=c_std -@GLIBCXX_C_HEADERS_EXTRA_TRUE@c_base_headers_extra = ${c_base_srcdir}/cmath.tcc -@GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@c_compatibility_headers_extra = @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@c_compatibility_headers_extra = ${c_compatibility_headers} host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR) host_builddir = ./${host_alias}/bits @@ -1138,10 +1135,10 @@ PCHFLAGS = -x c++-header -nostdinc++ $(CXXFLAGS) # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. allstamped = \ - stamp-std stamp-bits stamp-c_base stamp-c_base_extra \ - stamp-c_compatibility stamp-backward stamp-ext stamp-pb \ - stamp-tr1 stamp-tr1-impl stamp-decimal stamp-debug \ - stamp-parallel stamp-profile stamp-profile-impl stamp-host + stamp-std stamp-bits stamp-c_base stamp-c_compatibility \ + stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-tr1-impl \ + stamp-decimal stamp-debug stamp-parallel stamp-profile \ + stamp-profile-impl stamp-host # List of all files that are created by explicit building, editing, or diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath index 02ca6af..3469b38 100644 --- a/libstdc++-v3/include/c_global/cmath +++ b/libstdc++-v3/include/c_global/cmath @@ -76,20 +76,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // Forward declaration of a helper function. This really should be - // an `exported' forward declaration. - template<typename _Tp> - _Tp __cmath_power(_Tp, unsigned int); - - template<typename _Tp> - inline _Tp - __pow_helper(_Tp __x, int __n) - { - return __n < 0 - ? _Tp(1)/__cmath_power(__x, -__n) - : __cmath_power(__x, __n); - } - inline double abs(double __x) { return __builtin_fabs(__x); } @@ -859,10 +845,6 @@ _GLIBCXX_END_NAMESPACE #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ #endif -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/cmath.tcc> -#endif - #ifdef __GXX_EXPERIMENTAL_CXX0X__ # if defined(_GLIBCXX_INCLUDE_AS_TR1) # error C++0x header cannot be included from TR1 header diff --git a/libstdc++-v3/include/c_global/cmath.tcc b/libstdc++-v3/include/c_global/cmath.tcc deleted file mode 100644 index 9f4c853..0000000 --- a/libstdc++-v3/include/c_global/cmath.tcc +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- C math library. - -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// <http://www.gnu.org/licenses/>. - -// This file was written by Gabriel Dos Reis <gdr@codesourcery.com> - -/** @file cmath.tcc - * This is a Standard C++ Library file. - */ - -#ifndef _GLIBCXX_CMATH_TCC -#define _GLIBCXX_CMATH_TCC 1 - -_GLIBCXX_BEGIN_NAMESPACE(std) - - template<typename _Tp> - inline _Tp - __cmath_power(_Tp __x, unsigned int __n) - { - _Tp __y = __n % 2 ? __x : _Tp(1); - - while (__n >>= 1) - { - __x = __x * __x; - if (__n % 2) - __y = __y * __x; - } - - return __y; - } - -_GLIBCXX_END_NAMESPACE - -#endif diff --git a/libstdc++-v3/include/c_std/cmath b/libstdc++-v3/include/c_std/cmath index e970896..fcdfa15 100644 --- a/libstdc++-v3/include/c_std/cmath +++ b/libstdc++-v3/include/c_std/cmath @@ -77,10 +77,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // Forward declaration of a helper function. This really should be - // an `exported' forward declaration. - template<typename _Tp> _Tp __cmath_power(_Tp, unsigned int); - inline double abs(double __x) { return __builtin_fabs(__x); } @@ -344,15 +340,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) modf(long double __x, long double* __iptr) { return __builtin_modfl(__x, __iptr); } - template<typename _Tp> - inline _Tp - __pow_helper(_Tp __x, int __n) - { - return __n < 0 - ? _Tp(1)/__cmath_power(__x, -__n) - : __cmath_power(__x, __n); - } - using ::pow; inline float @@ -590,8 +577,4 @@ _GLIBCXX_END_NAMESPACE #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ #endif -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/cmath.tcc> -#endif - #endif diff --git a/libstdc++-v3/include/c_std/cmath.tcc b/libstdc++-v3/include/c_std/cmath.tcc deleted file mode 100644 index 9f4c853..0000000 --- a/libstdc++-v3/include/c_std/cmath.tcc +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- C math library. - -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// <http://www.gnu.org/licenses/>. - -// This file was written by Gabriel Dos Reis <gdr@codesourcery.com> - -/** @file cmath.tcc - * This is a Standard C++ Library file. - */ - -#ifndef _GLIBCXX_CMATH_TCC -#define _GLIBCXX_CMATH_TCC 1 - -_GLIBCXX_BEGIN_NAMESPACE(std) - - template<typename _Tp> - inline _Tp - __cmath_power(_Tp __x, unsigned int __n) - { - _Tp __y = __n % 2 ? __x : _Tp(1); - - while (__n >>= 1) - { - __x = __x * __x; - if (__n % 2) - __y = __y * __x; - } - - return __y; - } - -_GLIBCXX_END_NAMESPACE - -#endif diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex index 31c4436..9305651 100644 --- a/libstdc++-v3/include/std/complex +++ b/libstdc++-v3/include/std/complex @@ -951,12 +951,32 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // raised to the __y-th power. The branch // cut is on the negative axis. #ifndef __GXX_EXPERIMENTAL_CXX0X__ + template<typename _Tp> + complex<_Tp> + __complex_pow_unsigned(complex<_Tp> __x, unsigned __n) + { + complex<_Tp> __y = __n % 2 ? __x : complex<_Tp>(1); + + while (__n >>= 1) + { + __x *= __x; + if (__n % 2) + __y *= __x; + } + + return __y; + } + // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 844. complex pow return type is ambiguous. template<typename _Tp> inline complex<_Tp> pow(const complex<_Tp>& __z, int __n) - { return std::__pow_helper(__z, __n); } + { + return __n < 0 + ? complex<_Tp>(1) / std::__complex_pow_unsigned(__z, -__n) + : std::__complex_pow_unsigned(__z, __n); + } #endif template<typename _Tp> |