This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: equivalence croakage
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Hans Horn <hannes at 2horns dot com>
- Cc: fortran at gcc dot gnu dot org
- Date: Sun, 1 Nov 2009 16:30:24 -0800
- Subject: Re: equivalence croakage
- References: <hckp0n$oha$1@ger.gmane.org>
On Sun, Nov 01, 2009 at 11:53:58AM -0800, Hans Horn wrote:
> Folks,
>
> just trying to make the switch from g77 to gfortran (and from gcc3 to gcc4).
> When compiling some legacy f77 code that uses f77 equivalence
> statements, I get barfed at with the following (32bit environment):
>
> <During initialization>
>
> Error: Overlapping unequal initializers in EQUIVALENCE at (1)
>
> Doesn't tell at all where the shit is happening.
>
> This code happens to compile with various f77 compilers (aix xlf, g77).
>
> I collected all the equivalence statements from the offending f77 source
> (all more or less variations of the same theme):
>
> subroutine dud
> IMPLICIT NONE
> Character cDummy(8)/8*' '/, CSTORE(8)/8*' '/, CSTORE1(8)/8*' '/
> Integer iDummy(2), ISTORE(2), ISTORE1(2)
> Real*8 rDummy(1), XSTORE
>
> Equivalence(CSTORE(1),XSTORE,ISTORE)
> Equivalence(CSTORE1(1),ISTORE1)
> Equivalence(cDummy(1), iDummy(1), rDummy(1))
>
> end
>
> this just happens to compile w/o a problem.
>
> Am I being kicked by a gfortran bug?
>
Please show the complete error message.
Please show the actual code causing the problem.
Please report the version of gfortran that you are using.
Please report the options that you used.
I doubt that it's a bug in gfortran. I suspect it's a
bug in your code because using equivalence correctly is
actually more difficult than it may appear.
--
Steve