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: [PATCH] F77 on sparc64-*-*


Jeff wrote:

> I wrote:

  > The Fortran Frontend tries to enforce the Fortran rules here that say that
  > a REAL, an INTEGER and a LOGICAL all use the same amount of memory, and
  > that a DOUBLE PRECISION variable takes twice that.

Does the rule mandate that DOUBLE be twice a REAL?  What about targets where
that isn't actually possible? :-)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Yes, in the following sense (quoting Section 2.13 of the Fortran 77 Standard,
referred to on our `Readings' page):

_2.13 Storage

_A storage sequence is a sequence of storage units. A storage unit is either a numeric storage unit or a character storage unit.

An integer, real, or logical datum has one numeric storage unit in a storage sequence. A double precision or complex datum has two numeric storage units in a storage sequence. A character datum has one character storage unit in a storage sequence for each character in the datum. This standard does not specify a relationship between a numeric storage unit and a character storage unit.

If a datum requires more than one storage unit in a storage sequence, those storage units are consecutive.

The concept of a storage sequence is used to describe relationships that exist among variables, array elements, arrays, substrings, and common blocks. This standard does not specify a relationship between the storage sequence concept and the physical properties or implementation of storage.

[ hmmm, sorry for the oversized width of the above paragraph ]

Note that the text is referring to *storage* - it doesn't discuss how many
bits of the double-sized DOUBLE PRECISION storage you're required to *use*.

Although, at some other place in the Standard it is mentioned that
DOUBLE PRECISION should refer to a type with "more decimal precision"
than default REAL.

HTH.

Cheers,
Toon Moene.


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