aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-08-24 10:10:28 +0200
committerMartin Liska <mliska@suse.cz>2022-08-24 10:10:28 +0200
commit4483fe115cef3eea1d64e913816e2d117b38ac73 (patch)
treee9e49ed1ea26600674c1590d69bb5f458126b488 /gcc/fortran
parent9dfe1f671aee1e41ded1563ffd974f510800572b (diff)
parent42301c02e458cdce646ffaf7ea1df502ab2e8ddc (diff)
downloadgcc-4483fe115cef3eea1d64e913816e2d117b38ac73.zip
gcc-4483fe115cef3eea1d64e913816e2d117b38ac73.tar.gz
gcc-4483fe115cef3eea1d64e913816e2d117b38ac73.tar.bz2
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog26
-rw-r--r--gcc/fortran/check.cc23
-rw-r--r--gcc/fortran/lang.opt4
-rw-r--r--gcc/fortran/options.cc14
-rw-r--r--gcc/fortran/simplify.cc14
5 files changed, 44 insertions, 37 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 678059b..1352a54 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,29 @@
+2022-08-22 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/106557
+ * simplify.cc (gfc_simplify_ibclr): Ensure consistent results of
+ the simplification by dropping a redundant memory representation
+ of argument x.
+ (gfc_simplify_ibset): Likewise.
+
+2022-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/46539
+ * lang.opt (static-libgfortran, static-libquadmath): Change Fortran
+ to Driver.
+ * options.cc (gfc_handle_option): Don't handle OPT_static_libgfortran
+ nor OPT_static_libquadmath here.
+
+2022-08-18 Harald Anlauf <anlauf@gmx.de>
+
+ Revert:
+ 2022-07-31 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/77652
+ * check.cc (gfc_check_associated): Make the rank check of POINTER
+ vs. TARGET match the allowed forms of pointer assignment for the
+ selected Fortran standard.
+
2022-08-17 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/fortran/check.cc b/gcc/fortran/check.cc
index 1da0b3c..91d87a1 100644
--- a/gcc/fortran/check.cc
+++ b/gcc/fortran/check.cc
@@ -1502,27 +1502,8 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
t = false;
/* F2018 C838 explicitly allows an assumed-rank variable as the first
argument of intrinsic inquiry functions. */
- if (pointer->rank != -1 && pointer->rank != target->rank)
- {
- if (pointer->rank == 0 || target->rank == 0)
- {
- /* There exists no valid pointer assignment using bounds
- remapping for scalar => array or array => scalar. */
- if (!rank_check (target, 0, pointer->rank))
- t = false;
- }
- else if (target->rank != 1)
- {
- if (!gfc_notify_std (GFC_STD_F2008, "Rank remapping target is not "
- "rank 1 at %L", &target->where))
- t = false;
- }
- else if ((gfc_option.allow_std & GFC_STD_F2003) == 0)
- {
- if (!rank_check (target, 0, pointer->rank))
- t = false;
- }
- }
+ if (pointer->rank != -1 && !rank_check (target, 0, pointer->rank))
+ t = false;
if (target->rank > 0 && target->ref)
{
for (i = 0; i < target->rank; i++)
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index e8cd735..b18a6d3 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -860,11 +860,11 @@ Fortran Joined Separate
; Documented in common.opt
static-libgfortran
-Fortran
+Driver
Statically link the GNU Fortran helper library (libgfortran).
static-libquadmath
-Fortran
+Driver
Statically link the GCC Quad-Precision Math Library (libquadmath).
std=f2003
diff --git a/gcc/fortran/options.cc b/gcc/fortran/options.cc
index 38249d6..08afb78 100644
--- a/gcc/fortran/options.cc
+++ b/gcc/fortran/options.cc
@@ -685,20 +685,6 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
gfc_option.source_form = FORM_FREE;
break;
- case OPT_static_libgfortran:
-#ifndef HAVE_LD_STATIC_DYNAMIC
- gfc_fatal_error ("%<-static-libgfortran%> is not supported in this "
- "configuration");
-#endif
- break;
-
- case OPT_static_libquadmath:
-#ifndef HAVE_LD_STATIC_DYNAMIC
- gfc_fatal_error ("%<-static-libquadmath%> is not supported in this "
- "configuration");
-#endif
- break;
-
case OPT_fintrinsic_modules_path:
case OPT_fintrinsic_modules_path_:
diff --git a/gcc/fortran/simplify.cc b/gcc/fortran/simplify.cc
index fb72599..f992c31 100644
--- a/gcc/fortran/simplify.cc
+++ b/gcc/fortran/simplify.cc
@@ -3380,6 +3380,13 @@ gfc_simplify_ibclr (gfc_expr *x, gfc_expr *y)
k = gfc_validate_kind (x->ts.type, x->ts.kind, false);
result = gfc_copy_expr (x);
+ /* Drop any separate memory representation of x to avoid potential
+ inconsistencies in result. */
+ if (result->representation.string)
+ {
+ free (result->representation.string);
+ result->representation.string = NULL;
+ }
convert_mpz_to_unsigned (result->value.integer,
gfc_integer_kinds[k].bit_size);
@@ -3471,6 +3478,13 @@ gfc_simplify_ibset (gfc_expr *x, gfc_expr *y)
k = gfc_validate_kind (x->ts.type, x->ts.kind, false);
result = gfc_copy_expr (x);
+ /* Drop any separate memory representation of x to avoid potential
+ inconsistencies in result. */
+ if (result->representation.string)
+ {
+ free (result->representation.string);
+ result->representation.string = NULL;
+ }
convert_mpz_to_unsigned (result->value.integer,
gfc_integer_kinds[k].bit_size);