lfortran / lfortran

Official main repository for LFortran
https://lfortran.org/
Other
902 stars 134 forks source link

Equivalence error when arguments are array elements #4442

Open KGB99 opened 4 days ago

KGB99 commented 4 days ago

I have the following MRE:

      PROGRAM ERROR

      REAL               CI( 2, 2 ), CIV( 4 ), CR( 2, 2 ), CRV( 4 )

      EQUIVALENCE        ( CI( 1, 1 ), CIV( 1 ) ),
     $                   ( CR( 1, 1 ), CRV( 1 ) )

      END

which throws an error when compiling with LFortran but compiles with gfortran. The failing step is from AST to ASR. Equivalence is implemented so the following code for example does work:

      PROGRAM ERROR2

      REAL               A, B, C, D

      EQUIVALENCE        ( A, B ), ( C, D )

      END
KGB99 commented 4 days ago

This is discussed in #2523