This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gdb and g77


Jeffrey A Law <law@cygnus.com> writes:

The way it *should* work IMNSHO:
* A f77 3*2 array should be represented internally (tree nodes etc)
the same as a C 2*3 array:  I.e. a 2-element array of 3-element arrays.
* The stabs should be the same for a f77 3*2 array as for a C 2*3 array.
* The internal Gdb representation of a f77 3*2 array should be the
asme as a C 2*3 array.
* When Gdb evaluates the f77 experession A(i,j) it should do the same
thing as when evaluating the C expression A[j][i].  This re-arranging
can be done by the expression parsing, or (by using a different
expression opcode) in the expression evaluator.  Because the parser
cannot distinguish a function call from an array indexing operation,
it does the latter, using the opcode OP_F77_UNDETERMINED_ARGLIST.

Rationale:  Logically, a f77 3*2 array is equivalent to a C 2*3 array
- it is just the order of indexes that are different.  The difference is
not one of types, but of expression syntax.  Hence the types should
be represented the same.

I worked on this some years ago, trying to clean up some code from
Motorola, but it has been a while, and may well have bit-rotten
- or been wrong in the first place.
-- 
	--Per Bothner
bothner@pacbell.net     http://home.pacbell.net/bothner/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]