aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/fortran/lang.opt3
-rw-r--r--gcc/fortran/trans-intrinsic.c4
-rw-r--r--gcc/fortran/trans-types.c13
-rw-r--r--libgfortran/Makefile.am6
-rw-r--r--libgfortran/Makefile.in6
5 files changed, 23 insertions, 9 deletions
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 09d043e..ab92e0e 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -413,6 +413,9 @@ fblas-matmul-limit=
Fortran RejectNegative Joined UInteger Var(flag_blas_matmul_limit) Init(30)
-fblas-matmul-limit=<n> Size of the smallest matrix for which matmul will use BLAS.
+fbuilding-libgfortran
+Fortran Undocumented Var(flag_building_libgfortran)
+
fcheck-array-temporaries
Fortran
Produce a warning at runtime if a array temporary has been created for a procedure argument.
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index db1d87a..dc72d99 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -154,7 +154,9 @@ builtin_decl_for_precision (enum built_in_function base_built_in,
i = m->float_built_in;
else if (precision == TYPE_PRECISION (double_type_node))
i = m->double_built_in;
- else if (precision == TYPE_PRECISION (long_double_type_node))
+ else if (precision == TYPE_PRECISION (long_double_type_node)
+ && (!gfc_real16_is_float128
+ || long_double_type_node != gfc_float128_type_node))
i = m->long_double_built_in;
else if (precision == TYPE_PRECISION (gfc_float128_type_node))
{
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 147e825..5de43bb 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -516,7 +516,16 @@ gfc_init_kinds (void)
{
for (int i = 0; i < r_index; ++i)
if (gfc_real_kinds[i].kind == 16)
- gfc_real_kinds[i].abi_kind = 17;
+ {
+ gfc_real_kinds[i].abi_kind = 17;
+ if (flag_building_libgfortran
+ && (TARGET_GLIBC_MAJOR < 2
+ || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR < 32)))
+ {
+ gfc_real16_is_float128 = true;
+ gfc_real_kinds[i].c_float128 = 1;
+ }
+ }
}
/* Choose the default integer kind. We choose 4 unless the user directs us
@@ -859,7 +868,7 @@ gfc_build_real_type (gfc_real_info *info)
info->c_float = 1;
if (mode_precision == DOUBLE_TYPE_SIZE)
info->c_double = 1;
- if (mode_precision == LONG_DOUBLE_TYPE_SIZE)
+ if (mode_precision == LONG_DOUBLE_TYPE_SIZE && !info->c_float128)
info->c_long_double = 1;
if (mode_precision != LONG_DOUBLE_TYPE_SIZE && mode_precision == 128)
{
diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
index 9fb12ba..0074540 100644
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -1081,8 +1081,8 @@ endif
$(patsubst %.c,%.lo,$(notdir $(i_matmull_c))): AM_CFLAGS += -funroll-loops
# Add the -fallow-leading-underscore option when needed
-$(patsubst %.F90,%.lo,$(patsubst %.f90,%.lo,$(notdir $(gfor_specific_src)))): AM_FCFLAGS += -fallow-leading-underscore
-selected_real_kind.lo selected_int_kind.lo: AM_FCFLAGS += -fallow-leading-underscore
+$(patsubst %.F90,%.lo,$(patsubst %.f90,%.lo,$(notdir $(gfor_specific_src)))): AM_FCFLAGS += -fallow-leading-underscore -fbuilding-libgfortran
+selected_real_kind.lo selected_int_kind.lo: AM_FCFLAGS += -fallow-leading-underscore -fbuilding-libgfortran
# Build *_r17.F90 and *_c17.F90 with additional -mabi=ieeelongdouble on powerpc64le-linux.
@@ -1099,7 +1099,7 @@ endif
if IEEE_SUPPORT
# Add flags for IEEE modules
-$(patsubst %.F90,%.lo,$(notdir $(gfor_ieee_src))): AM_FCFLAGS += -Wno-unused-dummy-argument -Wno-c-binding-type -ffree-line-length-0 -fallow-leading-underscore -fsignaling-nans
+$(patsubst %.F90,%.lo,$(notdir $(gfor_ieee_src))): AM_FCFLAGS += -Wno-unused-dummy-argument -Wno-c-binding-type -ffree-line-length-0 -fallow-leading-underscore -fsignaling-nans -fbuilding-libgfortran
# Add flags for IEEE helper code
$(patsubst %.c,%.lo,$(notdir $(gfor_ieee_helper_src))): AM_CFLAGS += -fsignaling-nans
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
index da0ad68..fa5e215 100644
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -7634,8 +7634,8 @@ $(patsubst %.c,%.lo,$(notdir $(i_matmul_c))): AM_CFLAGS += -ffast-math -ftree-ve
$(patsubst %.c,%.lo,$(notdir $(i_matmull_c))): AM_CFLAGS += -funroll-loops
# Add the -fallow-leading-underscore option when needed
-$(patsubst %.F90,%.lo,$(patsubst %.f90,%.lo,$(notdir $(gfor_specific_src)))): AM_FCFLAGS += -fallow-leading-underscore
-selected_real_kind.lo selected_int_kind.lo: AM_FCFLAGS += -fallow-leading-underscore
+$(patsubst %.F90,%.lo,$(patsubst %.f90,%.lo,$(notdir $(gfor_specific_src)))): AM_FCFLAGS += -fallow-leading-underscore -fbuilding-libgfortran
+selected_real_kind.lo selected_int_kind.lo: AM_FCFLAGS += -fallow-leading-underscore -fbuilding-libgfortran
# Build *_r17.F90 and *_c17.F90 with additional -mabi=ieeelongdouble on powerpc64le-linux.
@@ -7649,7 +7649,7 @@ selected_real_kind.lo selected_int_kind.lo: AM_FCFLAGS += -fallow-leading-unders
@HAVE_REAL_17_TRUE@$(patsubst %_c17.c,%_c17.lo,$(notdir $(gfor_built_src))): AM_CFLAGS += -mabi=ieeelongdouble
# Add flags for IEEE modules
-@IEEE_SUPPORT_TRUE@$(patsubst %.F90,%.lo,$(notdir $(gfor_ieee_src))): AM_FCFLAGS += -Wno-unused-dummy-argument -Wno-c-binding-type -ffree-line-length-0 -fallow-leading-underscore -fsignaling-nans
+@IEEE_SUPPORT_TRUE@$(patsubst %.F90,%.lo,$(notdir $(gfor_ieee_src))): AM_FCFLAGS += -Wno-unused-dummy-argument -Wno-c-binding-type -ffree-line-length-0 -fallow-leading-underscore -fsignaling-nans -fbuilding-libgfortran
# Add flags for IEEE helper code
@IEEE_SUPPORT_TRUE@$(patsubst %.c,%.lo,$(notdir $(gfor_ieee_helper_src))): AM_CFLAGS += -fsignaling-nans