summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-24 10:54:56 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-24 10:54:56 +0000
commita2ccae9c67b37923af60962abb2974dbed4118ac (patch)
tree65a66d34e3814901dabcd01248387ba7cb0c94b2
parent5d46bf2a60f65efeaee816a6bbe994dd8efaeae6 (diff)
downloadgcc-a2ccae9c67b37923af60962abb2974dbed4118ac.tar.gz
PR target/78478
* config/ax_check_define.m4: New file. libgfortran/ChangeLog: PR target/78478 * acinclude.m4: Include ../config/ax_check_define.m4 * configure.ac: Check if _SOFT_FLOAT is defined. * configure.host (i?86 | x86_64): Use fpu-generic when have_soft_float is set. * configure: Regenerate. gcc/ChangeLog: PR target/78478 Revert: 2013-11-05 Uros Bizjak <ubizjak@gmail.com> * config/i386/rtemself.h (LONG_DOUBLE_TYPE_SIZE): New define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@244862 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog5
-rw-r--r--config/ax_check_define.m492
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/i386/rtemself.h3
-rw-r--r--libgfortran/ChangeLog20
-rw-r--r--libgfortran/acinclude.m41
-rwxr-xr-xlibgfortran/configure41
-rw-r--r--libgfortran/configure.ac3
-rw-r--r--libgfortran/configure.host6
9 files changed, 168 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 02e1282205d..1d8cda4d924 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-24 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/78478
+ * config/ax_check_define.m4: New file.
+
2017-01-09 Andreas Tobler <andreast@gcc.gnu.org>
Backport from mainline
diff --git a/config/ax_check_define.m4 b/config/ax_check_define.m4
new file mode 100644
index 00000000000..4bc694861c0
--- /dev/null
+++ b/config/ax_check_define.m4
@@ -0,0 +1,92 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_define.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_DEFINE([symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
+# AX_CHECK_DEFINE([includes],[symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
+#
+# DESCRIPTION
+#
+# Complements AC_CHECK_FUNC but it does not check for a function but for a
+# define to exist. Consider a usage like:
+#
+# AC_CHECK_DEFINE(__STRICT_ANSI__, CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500")
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program 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.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 8
+
+AU_ALIAS([AC_CHECK_DEFINED], [AC_CHECK_DEFINE])
+AC_DEFUN([AC_CHECK_DEFINE],[
+AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1])dnl
+AC_CACHE_CHECK([for $1 defined], ac_var,
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ #ifdef $1
+ int ok;
+ #else
+ choke me
+ #endif
+]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
+AS_IF([test AS_VAR_GET(ac_var) != "no"], [$2], [$3])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])
+
+AU_ALIAS([AX_CHECK_DEFINED], [AX_CHECK_DEFINE])
+AC_DEFUN([AX_CHECK_DEFINE],[
+AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$2_$1])dnl
+AC_CACHE_CHECK([for $2 defined in $1], ac_var,
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <$1>]], [[
+ #ifdef $2
+ int ok;
+ #else
+ choke me
+ #endif
+]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
+AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])
+
+AC_DEFUN([AX_CHECK_FUNC],
+[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$2])dnl
+AC_CACHE_CHECK([for $2], ac_var,
+dnl AC_LANG_FUNC_LINK_TRY
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([$1
+ #undef $2
+ char $2 ();],[
+ char (*f) () = $2;
+ return f != $2; ])],
+ [AS_VAR_SET(ac_var, yes)],
+ [AS_VAR_SET(ac_var, no)])])
+AS_IF([test AS_VAR_GET(ac_var) = yes], [$3], [$4])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])# AC_CHECK_FUNC
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a2bf308267a..7227f61ba71 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2017-01-24 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/78478
+ Revert:
+ 2013-11-05 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/rtemself.h (LONG_DOUBLE_TYPE_SIZE): New define.
+
2017-01-23 Martin Liska <mliska@suse.cz>
Backport from mainline
diff --git a/gcc/config/i386/rtemself.h b/gcc/config/i386/rtemself.h
index 8b7dc5e5d17..be711c80197 100644
--- a/gcc/config/i386/rtemself.h
+++ b/gcc/config/i386/rtemself.h
@@ -29,7 +29,4 @@ along with GCC; see the file COPYING3. If not see
} \
while (0)
-#undef LONG_DOUBLE_TYPE_SIZE
-#define LONG_DOUBLE_TYPE_SIZE (TARGET_80387 ? 80 : 64)
-
#define IX86_NO_LIBGCC_TFMODE
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 66cef90d4b2..c6e9872703f 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,12 @@
+2017-01-24 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/78478
+ * acinclude.m4: Include ../config/ax_check_define.m4
+ * configure.ac: Check if _SOFT_FLOAT is defined.
+ * configure.host (i?86 | x86_64): Use fpu-generic when
+ have_soft_float is set.
+ * configure: Regenerate.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
@@ -13,14 +22,14 @@
Backport from trunk
PR libgfortran/77707
- io/transfer.c (next_record): Flush before calculating next_record.
+ * io/transfer.c (next_record): Flush before calculating next_record.
Correctly calculate.
2016-09-28 Steven G. Kargl <kargl@gcc.gnu.org>
Backport from trunk
PR fortran/77507
- * ieee/ieee_arithmetic.F90 (IEEE_VALUE_4,IEEE_VALUE_8,IEEE_VALULE_10,
+ * ieee/ieee_arithmetic.F90 (IEEE_VALUE_4,IEEE_VALUE_8,IEEE_VALULE_10,
IEEE_VALUE_16): Use correct keyword.
2016-08-22 Release Manager
@@ -82,9 +91,10 @@
(read_logical): If '!' bang encountered when not in namelist mode got
bad_logical to give an error. (read_integer): Likewise reject '!'.
(read_character): Remove condition testing c = '!' which is now inside
- the is_separator macro. (parse_real): Reject '!' unless in namelist mode.
- (read_complex): Reject '!' unless in namelist mode. (read_real): Likewise
- reject '!'.
+ the is_separator macro. (parse_real): Reject '!' unless in
+ namelist mode.
+ (read_complex): Reject '!' unless in namelist mode.
+ (read_real): Likewise reject '!'.
2016-02-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
index 7280bc37a0b..1b20d10c9f4 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -1,6 +1,7 @@
m4_include(../config/acx.m4)
m4_include(../config/no-executables.m4)
m4_include(../config/math.m4)
+m4_include(../config/ax_check_define.m4)
dnl Check that we have a working GNU Fortran compiler
AC_DEFUN([LIBGFOR_WORKING_GFORTRAN], [
diff --git a/libgfortran/configure b/libgfortran/configure
index f746f6f5d1d..db607eb5954 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -10308,7 +10308,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@@ -14157,7 +14157,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@@ -25762,6 +25762,43 @@ $as_echo "#define HAVE_FP_ENABLE 1" >>confdefs.h
fi
+# Check if _SOFT_FLOAT is defined
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _SOFT_FLOAT defined" >&5
+$as_echo_n "checking for _SOFT_FLOAT defined... " >&6; }
+if test "${ac_cv_defined__SOFT_FLOAT+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ #ifdef _SOFT_FLOAT
+ int ok;
+ #else
+ choke me
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_defined__SOFT_FLOAT=yes
+else
+ ac_cv_defined__SOFT_FLOAT=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_defined__SOFT_FLOAT" >&5
+$as_echo "$ac_cv_defined__SOFT_FLOAT" >&6; }
+if test $ac_cv_defined__SOFT_FLOAT != "no"; then :
+ have_soft_float=yes
+fi
+
# Runs configure.host to set up necessary host-dependent shell variables.
# We then display a message about it, and propagate them through the
# build chain.
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 8f377bb4b50..5a264942b6d 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -551,6 +551,9 @@ AC_CHECK_FUNC([fpresetsticky],[have_fpresetsticky=yes AC_DEFINE([HAVE_FPRESETSTI
AC_CHECK_FUNC([fp_trap],[have_fp_trap=yes AC_DEFINE([HAVE_FP_TRAP],[1],[fp_trap is present])])
AC_CHECK_FUNC([fp_enable],[have_fp_enable=yes AC_DEFINE([HAVE_FP_ENABLE],[1],[fp_enable is present])])
+# Check if _SOFT_FLOAT is defined
+AC_CHECK_DEFINE([_SOFT_FLOAT],[have_soft_float=yes])
+
# Runs configure.host to set up necessary host-dependent shell variables.
# We then display a message about it, and propagate them through the
# build chain.
diff --git a/libgfortran/configure.host b/libgfortran/configure.host
index 0a12a32fc8a..5824f253e2f 100644
--- a/libgfortran/configure.host
+++ b/libgfortran/configure.host
@@ -40,7 +40,11 @@ fi
# the x86 denormal exception.
case "${host_cpu}" in
i?86 | x86_64)
- fpu_host='fpu-387'
+ if test "x${have_soft_float}" = "xyes"; then
+ fpu_host='fpu-generic'
+ else
+ fpu_host='fpu-387'
+ fi
ieee_support='yes'
;;
esac