[Bug fortran/112316] [13 Regression] Fix for PR87477 rejects valid code with a bogus error about pointer assignment and causes an ICE since r13-7761-gd6997a5aab7aaa325946a6283bfee8ac2bd9f540

pault at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 2 17:56:17 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112316

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-11-02
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Paul Thomas <pault at gcc dot gnu.org> ---
I can confirm this bug, of course. Thanks for the report.

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

The problem is caused by a stupid (on my part :-( ) oversight:
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;

fixes the problem and regtests OK.

The simplification that I effected with the offending patch has been completely
spoiled by forgetting that one of the cases that was supposed to be fixed in
the block following the condition above is that of target->rank = 0 and the
associate variable having an array_spec.

I will commit a cleaned up version as obvious first thing tomorrow morning.

Sorry for the inconvenience.

Paul


More information about the Gcc-bugs mailing list