Go to the first, previous, next, last section, table of contents.


Local Equivalence Areas (EQUIVALENCE)

g77 treats storage-associated areas involving a COMMON block as explained in the section on common blocks.

A local EQUIVALENCE area is a collection of variables and arrays connected to each other in any way via EQUIVALENCE, none of which are listed in a COMMON statement.

Currently, g77 does not emit "true" debugging information for members in a local EQUIVALENCE area, due to an apparent bug in the GBE.

(As of Version 0.5.19, g77 does emit debugging information for such members in the form of a constant string specifying the base name of the aggregate area and the offset of the member in bytes from the start of the area. Use the `-fdebug-kludge' option to enable this behavior. In gdb, use `set language c' before printing the value of the member, then `set language fortran' to restore the default language, since gdb doesn't provide a way to print a readable version of a character string in Fortran language mode.

This kludge will be removed in a future version of g77 that, in conjunction with a contemporary version of gdb, properly supports Fortran-language debugging, including access to members of EQUIVALENCE areas.)

See section Options for Code Generation Conventions, for information on the `-fdebug-kludge' option.

Moreover, g77 implements a local EQUIVALENCE area such that its type is an array of the C char data type.

The name g77 gives this array of char type is `__g77_equiv_x', where x is the name of the item that is placed at the beginning (offset 0) of this array. If more than one such item is placed at the beginning, x is the name that sorts to the top in an alphabetical sort of the list of such items.

When debugging, you must therefore access members of EQUIVALENCE areas by specifying the appropriate `__g77_equiv_x' array section with the appropriate offset. See the explanation of debugging COMMON blocks for info applicable to debugging local EQUIVALENCE areas.

(Note: g77 version 0.5.18 and earlier chose the name for x using a different method when more than one name was in the list of names of entities placed at the beginning of the array. Though the documentation specified that the first name listed in the EQUIVALENCE statements was chosen for x, g77 in fact chose the name using a method that was so complicated, it seemed easier to change it to an alphabetical sort than to describe the previous method in the documentation.)


Go to the first, previous, next, last section, table of contents.