aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2009-12-06 16:11:06 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2009-12-06 16:11:06 +0000
commit3a5729ea2a8441fe2f9e583fb2ae28b56df2e24c (patch)
treea04b6f17ad0c012c98a09d540227bd781ca58190
parent2ef0f9c6ebaa083a936c6cfa6c90295a8c4b89b6 (diff)
downloadgcc-3a5729ea2a8441fe2f9e583fb2ae28b56df2e24c.zip
gcc-3a5729ea2a8441fe2f9e583fb2ae28b56df2e24c.tar.gz
gcc-3a5729ea2a8441fe2f9e583fb2ae28b56df2e24c.tar.bz2
re PR middle-end/30447 (Evaluate complex math functions at compile-time)
PR middle-end/30447 PR middle-end/30789 PR other/40302 * configure.ac: Require MPC. * configure: Regenerate. gcc: * doc/install.texi: Document MPC is required. From-SVN: r155023
-rw-r--r--ChangeLog9
-rwxr-xr-xconfigure118
-rw-r--r--configure.ac96
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/doc/install.texi22
5 files changed, 89 insertions, 160 deletions
diff --git a/ChangeLog b/ChangeLog
index 943d26a..6989afa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-12-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ PR middle-end/30447
+ PR middle-end/30789
+ PR other/40302
+
+ * configure.ac: Require MPC.
+ * configure: Regenerate.
+
2009-12-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR target/38384
diff --git a/configure b/configure
index d7d7e12..0223683 100755
--- a/configure
+++ b/configure
@@ -5285,12 +5285,9 @@ fi
# Check for GMP, MPFR and MPC
-gmplibs="-lmpfr -lgmp"
+gmplibs="-lmpc -lmpfr -lgmp"
gmpinc=
have_gmp=no
-mpclibs=-lmpc
-mpcinc=
-have_mpc=no
# Specify a location for mpc
# check for this first so it ends up on the link line before mpfr.
@@ -5314,23 +5311,23 @@ fi
if test "x$with_mpc" != x; then
- mpclibs="-L$with_mpc/lib -lmpc"
- mpcinc="-I$with_mpc/include $mpcinc"
+ gmplibs="-L$with_mpc/lib $gmplibs"
+ gmpinc="-I$with_mpc/include $gmpinc"
fi
if test "x$with_mpc_include" != x; then
- mpcinc="-I$with_mpc_include $mpcinc"
+ gmpinc="-I$with_mpc_include $gmpinc"
fi
if test "x$with_mpc_lib" != x; then
- mpclibs="-L$with_mpc_lib -lmpc"
+ gmplibs="-L$with_mpc_lib $gmplibs"
fi
if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
- mpclibs='-L$$r/$(HOST_SUBDIR)/mpc/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/_libs -lmpc'
- mpcinc='-I$$s/mpc/src '"$mpcinc"
+ gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/_libs '"$gmplibs"
+ gmpinc='-I$$s/mpc/src '"$gmpinc"
# Do not test the mpc version. Assume that it is sufficient, since
# it is in the source tree, and the library has not been built yet
# but it would be included on the link line in the version check below
# hence making the test fail.
- have_mpc=yes
+ have_gmp=yes
fi
# Specify a location for mpfr
@@ -5364,10 +5361,10 @@ fi
if test "x$with_mpfr" != x; then
gmplibs="-L$with_mpfr/lib $gmplibs"
- gmpinc="-I$with_mpfr/include"
+ gmpinc="-I$with_mpfr/include $gmpinc"
fi
if test "x$with_mpfr_include" != x; then
- gmpinc="-I$with_mpfr_include"
+ gmpinc="-I$with_mpfr_include $gmpinc"
fi
if test "x$with_mpfr_lib" != x; then
gmplibs="-L$with_mpfr_lib $gmplibs"
@@ -5519,8 +5516,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
# Check for the MPC header version.
- if test x"$have_mpc" != xyes ; then
- CFLAGS="$CFLAGS $mpcinc"
+ if test x"$have_gmp" = xyes ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the correct version of mpc.h" >&5
$as_echo_n "checking for the correct version of mpc.h... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5540,10 +5536,10 @@ main ()
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }; have_mpc=maybe
+$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }; have_mpc=no; mpclibs= ; mpcinc=
+$as_echo "no" >&6; }; have_gmp=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
@@ -5552,24 +5548,32 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test x"$have_gmp" = xyes; then
saved_LIBS="$LIBS"
LIBS="$LIBS $gmplibs"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the correct version of the gmp/mpfr libraries" >&5
-$as_echo_n "checking for the correct version of the gmp/mpfr libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the correct version of the gmp/mpfr/mpc libraries" >&5
+$as_echo_n "checking for the correct version of the gmp/mpfr/mpc libraries... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <gmp.h>
- #include <mpfr.h>
+#include <mpc.h>
int
main ()
{
mpfr_t n;
mpfr_t x;
+ mpc_t c;
int t;
mpfr_init (n);
mpfr_init (x);
mpfr_atan2 (n, n, x, GMP_RNDN);
mpfr_erfc (n, x, GMP_RNDN);
mpfr_subnormalize (x, t, GMP_RNDN);
+ mpfr_clear(n);
+ mpfr_clear(x);
+ mpc_init2 (c, 53);
+ mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
+ mpc_cosh (c, c, MPC_RNDNN);
+ mpc_pow (c, c, c, MPC_RNDNN);
+ mpc_acosh (c, c, MPC_RNDNN);
+ mpc_clear (c);
;
return 0;
@@ -5587,75 +5591,21 @@ rm -f core conftest.err conftest.$ac_objext \
LIBS="$saved_LIBS"
fi
- if test x"$have_mpc" = xmaybe; then
- saved_LIBS="$LIBS"
- LIBS="$LIBS $mpclibs $gmplibs"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the correct version of the mpc library" >&5
-$as_echo_n "checking for the correct version of the mpc library... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <mpc.h>
-int
-main ()
-{
-
- mpc_t n;
- mpc_init2 (n, 53);
- mpc_set_ui_ui (n, 1, 1, MPC_RNDNN);
- mpc_sin (n, n, MPC_RNDNN);
- mpc_cos (n, n, MPC_RNDNN);
- mpc_tan (n, n, MPC_RNDNN);
- mpc_sinh (n, n, MPC_RNDNN);
- mpc_cosh (n, n, MPC_RNDNN);
- mpc_tanh (n, n, MPC_RNDNN);
- mpc_exp (n, n, MPC_RNDNN);
- mpc_log (n, n, MPC_RNDNN);
- mpc_sqrt (n, n, MPC_RNDNN);
- mpc_proj (n, n, MPC_RNDNN);
- mpc_neg (n, n, MPC_RNDNN);
- mpc_sqr (n, n, MPC_RNDNN);
- mpc_pow (n, n, n, MPC_RNDNN);
- mpc_acosh (n, n, MPC_RNDNN);
- mpc_clear (n);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }; have_mpc=yes
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }; have_mpc=no; mpclibs= ; mpcinc=
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS="$saved_LIBS"
- fi
-
CFLAGS="$saved_CFLAGS"
if test x$have_gmp != xyes; then
- as_fn_error "Building GCC requires GMP 4.2+ and MPFR 2.3.2+.
-Try the --with-gmp and/or --with-mpfr options to specify their locations.
-Copies of these libraries' source code can be found at their respective
-hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
-See also http://gcc.gnu.org/install/prerequisites.html for additional info.
-If you obtained GMP and/or MPFR from a vendor distribution package, make
-sure that you have installed both the libraries and the header files.
-They may be located in separate packages." "$LINENO" 5
+ as_fn_error "Building GCC requires GMP 4.2+, MPFR 2.3.2+ and MPC 0.8.0+.
+Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
+their locations. Source code for these libraries can be found at
+their respective hosting sites as well as at
+ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
+http://gcc.gnu.org/install/prerequisites.html for additional info. If
+you obtained GMP, MPFR and/or MPC from a vendor distribution package,
+make sure that you have installed both the libraries and the header
+files. They may be located in separate packages." "$LINENO" 5
fi
fi
-if test x$have_mpc != xyes ; then
- mpcinc=
- mpclibs=
-fi
-
-gmpinc="$mpcinc $gmpinc"
-gmplibs="$mpclibs $gmplibs"
-
# Flags needed for both GMP, MPFR and/or MPC.
diff --git a/configure.ac b/configure.ac
index c9c5f0a..dbc1565 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1228,12 +1228,9 @@ ENABLE_BUILD_WITH_CXX=$enableval,
ENABLE_BUILD_WITH_CXX=no)
# Check for GMP, MPFR and MPC
-gmplibs="-lmpfr -lgmp"
+gmplibs="-lmpc -lmpfr -lgmp"
gmpinc=
have_gmp=no
-mpclibs=-lmpc
-mpcinc=
-have_mpc=no
# Specify a location for mpc
# check for this first so it ends up on the link line before mpfr.
@@ -1245,23 +1242,23 @@ AC_ARG_WITH(mpc_include, [ --with-mpc-include=PATH
AC_ARG_WITH(mpc_lib, [ --with-mpc-lib=PATH specify directory for the installed MPC library])
if test "x$with_mpc" != x; then
- mpclibs="-L$with_mpc/lib -lmpc"
- mpcinc="-I$with_mpc/include $mpcinc"
+ gmplibs="-L$with_mpc/lib $gmplibs"
+ gmpinc="-I$with_mpc/include $gmpinc"
fi
if test "x$with_mpc_include" != x; then
- mpcinc="-I$with_mpc_include $mpcinc"
+ gmpinc="-I$with_mpc_include $gmpinc"
fi
if test "x$with_mpc_lib" != x; then
- mpclibs="-L$with_mpc_lib -lmpc"
+ gmplibs="-L$with_mpc_lib $gmplibs"
fi
if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
- mpclibs='-L$$r/$(HOST_SUBDIR)/mpc/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/_libs -lmpc'
- mpcinc='-I$$s/mpc/src '"$mpcinc"
+ gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/_libs '"$gmplibs"
+ gmpinc='-I$$s/mpc/src '"$gmpinc"
# Do not test the mpc version. Assume that it is sufficient, since
# it is in the source tree, and the library has not been built yet
# but it would be included on the link line in the version check below
# hence making the test fail.
- have_mpc=yes
+ have_gmp=yes
fi
# Specify a location for mpfr
@@ -1279,10 +1276,10 @@ AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=PATH specify directory for the insta
if test "x$with_mpfr" != x; then
gmplibs="-L$with_mpfr/lib $gmplibs"
- gmpinc="-I$with_mpfr/include"
+ gmpinc="-I$with_mpfr/include $gmpinc"
fi
if test "x$with_mpfr_include" != x; then
- gmpinc="-I$with_mpfr_include"
+ gmpinc="-I$with_mpfr_include $gmpinc"
fi
if test "x$with_mpfr_lib" != x; then
gmplibs="-L$with_mpfr_lib $gmplibs"
@@ -1363,86 +1360,57 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
fi
# Check for the MPC header version.
- if test x"$have_mpc" != xyes ; then
- CFLAGS="$CFLAGS $mpcinc"
+ if test x"$have_gmp" = xyes ; then
AC_MSG_CHECKING([for the correct version of mpc.h])
AC_TRY_COMPILE([#include <mpc.h>],[
#if MPC_VERSION < MPC_VERSION_NUM (0,8,0)
choke me
#endif
- ], [AC_MSG_RESULT([yes]); have_mpc=maybe],
- [AC_MSG_RESULT([no]); have_mpc=no; mpclibs= ; mpcinc= ])
+ ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
fi
# Now check the MPFR library.
if test x"$have_gmp" = xyes; then
saved_LIBS="$LIBS"
LIBS="$LIBS $gmplibs"
- AC_MSG_CHECKING([for the correct version of the gmp/mpfr libraries])
- AC_TRY_LINK([#include <gmp.h>
- #include <mpfr.h>],[
+ AC_MSG_CHECKING([for the correct version of the gmp/mpfr/mpc libraries])
+ AC_TRY_LINK([#include <mpc.h>],[
mpfr_t n;
mpfr_t x;
+ mpc_t c;
int t;
mpfr_init (n);
mpfr_init (x);
mpfr_atan2 (n, n, x, GMP_RNDN);
mpfr_erfc (n, x, GMP_RNDN);
mpfr_subnormalize (x, t, GMP_RNDN);
+ mpfr_clear(n);
+ mpfr_clear(x);
+ mpc_init2 (c, 53);
+ mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
+ mpc_cosh (c, c, MPC_RNDNN);
+ mpc_pow (c, c, c, MPC_RNDNN);
+ mpc_acosh (c, c, MPC_RNDNN);
+ mpc_clear (c);
], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
LIBS="$saved_LIBS"
fi
- if test x"$have_mpc" = xmaybe; then
- saved_LIBS="$LIBS"
- LIBS="$LIBS $mpclibs $gmplibs"
- AC_MSG_CHECKING([for the correct version of the mpc library])
- AC_TRY_LINK([#include <mpc.h>],[
- mpc_t n;
- mpc_init2 (n, 53);
- mpc_set_ui_ui (n, 1, 1, MPC_RNDNN);
- mpc_sin (n, n, MPC_RNDNN);
- mpc_cos (n, n, MPC_RNDNN);
- mpc_tan (n, n, MPC_RNDNN);
- mpc_sinh (n, n, MPC_RNDNN);
- mpc_cosh (n, n, MPC_RNDNN);
- mpc_tanh (n, n, MPC_RNDNN);
- mpc_exp (n, n, MPC_RNDNN);
- mpc_log (n, n, MPC_RNDNN);
- mpc_sqrt (n, n, MPC_RNDNN);
- mpc_proj (n, n, MPC_RNDNN);
- mpc_neg (n, n, MPC_RNDNN);
- mpc_sqr (n, n, MPC_RNDNN);
- mpc_pow (n, n, n, MPC_RNDNN);
- mpc_acosh (n, n, MPC_RNDNN);
- mpc_clear (n);
- ], [AC_MSG_RESULT([yes]); have_mpc=yes],
- [AC_MSG_RESULT([no]); have_mpc=no; mpclibs= ; mpcinc= ])
- LIBS="$saved_LIBS"
- fi
-
CFLAGS="$saved_CFLAGS"
if test x$have_gmp != xyes; then
- AC_MSG_ERROR([Building GCC requires GMP 4.2+ and MPFR 2.3.2+.
-Try the --with-gmp and/or --with-mpfr options to specify their locations.
-Copies of these libraries' source code can be found at their respective
-hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
-See also http://gcc.gnu.org/install/prerequisites.html for additional info.
-If you obtained GMP and/or MPFR from a vendor distribution package, make
-sure that you have installed both the libraries and the header files.
-They may be located in separate packages.])
+ AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.3.2+ and MPC 0.8.0+.
+Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
+their locations. Source code for these libraries can be found at
+their respective hosting sites as well as at
+ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
+http://gcc.gnu.org/install/prerequisites.html for additional info. If
+you obtained GMP, MPFR and/or MPC from a vendor distribution package,
+make sure that you have installed both the libraries and the header
+files. They may be located in separate packages.])
fi
fi
-if test x$have_mpc != xyes ; then
- mpcinc=
- mpclibs=
-fi
-
-gmpinc="$mpcinc $gmpinc"
-gmplibs="$mpclibs $gmplibs"
-
# Flags needed for both GMP, MPFR and/or MPC.
AC_SUBST(gmplibs)
AC_SUBST(gmpinc)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c7a81fe..f172477 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2009-12-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * doc/install.texi: Document MPC is required.
+
2009-12-06 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386-md (g): Add HImode and QImode.
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index a98c45f..977aa80 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -321,6 +321,16 @@ default library search path. See also @option{--with-mpfr-lib} and
distribution is found in a subdirectory of your GCC sources named
@file{mpfr}, it will be built together with GCC@.
+@item MPC Library version 0.8.0 (or later)
+
+Necessary to build GCC@. It can be downloaded from
+@uref{http://www.multiprecision.org/}. The @option{--with-mpc}
+configure option should be used if your MPC Library is not installed
+in your default library search path. See also @option{--with-mpc-lib}
+and @option{--with-mpc-include}. Alternatively, if an MPC source
+distribution is found in a subdirectory of your GCC sources named
+@file{mpc}, it will be built together with GCC@.
+
@item Parma Polyhedra Library (PPL) version 0.10
Necessary to build GCC with the Graphite loop optimizations.
@@ -344,18 +354,6 @@ not installed in your default library search path.
Necessary to build libgcj, the GCJ runtime.
-@item MPC Library version 0.8.0 (or later)
-
-Optional when building GCC@. Having this library will enable
-additional optimizations on complex numbers. It can be downloaded
-from @uref{http://www.multiprecision.org/mpc/}. The
-@option{--with-mpc} configure option should be used if your MPC
-Library is not installed in your default library search path. See
-also @option{--with-mpc-lib} and @option{--with-mpc-include}.
-Alternatively, if an MPC source distribution is found in a
-subdirectory of your GCC sources named @file{mpc}, it will be built
-together with GCC@.
-
@item libelf version 0.8.12 (or later)
Necessary to build link-time optimization (LTO) support. It can be