[fortran] PR112316 - [13 Regression] Fix for PR87477 rejects valid code with a bogus error...

Message ID CAGkQGiKWiCVkVTrPbyRWExyg1vL3xqfBYk6_h0_o9s3Hpva1gg@mail.gmail.com
State Not Applicable
Headers
Series [fortran] PR112316 - [13 Regression] Fix for PR87477 rejects valid code with a bogus error... |

Checks

Context Check Description
snail/gcc-patch-check fail Git am fail log

Commit Message

Paul Richard Thomas Nov. 3, 2023, 6:44 a.m. UTC
  Hi All,

I have pushed as 'obvious' a fix for this regression to both 13-branch and
mainline. The patch itself looks substantial but it consists entirely of
the removal of a condition and repagination of the corresponding block.
Please see below for part of my first comment on the PR for an explanation.

Paul

A temporary work around is to invert the order of the contained procedures.

The problem is caused by a stupid (on my part :-( ) oversight:

fixes the problem and regtests OK.
  

Patch

diff --git a/gcc/fortran/parse.cc b/gcc/fortran/parse.cc
index e103ebee557..f88f9be3be8 100644
--- a/gcc/fortran/parse.cc
+++ b/gcc/fortran/parse.cc
@@ -5196,7 +5196,7 @@  parse_associate (void)
            }
        }

-      if (target->rank)
+      if (1)
        {
          int rank = 0;
          rank = target->rank;