aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2022-08-18 21:24:29 +0200
committerHarald Anlauf <anlauf@gmx.de>2022-08-18 21:24:29 +0200
commitca170ed9f8a086ca7e1eec841882b6bed9ec1a3a (patch)
tree03a41cb1afdf8b04b8d6407af2d65637e7d79a3a /gcc/fortran
parent7f5ec900e53f6c7f7c06c641b4fb303ebdc83785 (diff)
downloadgcc-ca170ed9f8a086ca7e1eec841882b6bed9ec1a3a.zip
gcc-ca170ed9f8a086ca7e1eec841882b6bed9ec1a3a.tar.gz
gcc-ca170ed9f8a086ca7e1eec841882b6bed9ec1a3a.tar.bz2
Revert "Fortran: fix invalid rank error in ASSOCIATED when rank is remapped [PR77652]"
This reverts commit 0110cfd5449bae3a772f45ea2e4c5dab5b7a8ccd.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/check.cc23
1 files changed, 2 insertions, 21 deletions
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++)