g77 alignment bug (egcs-1.1.1)

Josip Loncaric josip@icase.edu
Thu Feb 4 09:55:00 GMT 1999


craig@jcb-sc.com wrote:
> 
> Therefore, this deficiency is also a *porting* issue, as with many others
> (some clearly of higher priority, like intrinsics in PARAMETER) --
> until we fix this, g77 isn't as good a target for porting software
> on the x86 architecture.

This comment goes directly to the heart of the matter.  Fortran is THE
language of the past which retains its importance because so much
scientific software is written in Fortran.  Some Fortran codes still in
use today are almost 40 years old by now, and have so many layers of
stuff added over the years that it difficult to find their original
core.

However, these codes are by now well tested and calibrated, and
therefore not likely to be replaced any time soon.  Fortran has an
important job to do, which is to extend to new machines the usefulness
of these elaborate applications developed through many decades of
effort.

The application we ported to x86 (Linux) has been around for at least a
decade, and it includes over a thousand files of Fortran code.  It runs
on Alpha (both Linux and DEC), R10000 (and other SGI machines), Cray
(C-90, YMP8/64, etc.), IBM SP2, etc.  On most of these machines, double
precision is *the* standard, and 8-byte alignment applies.  It remains
to be seen which, if any, Fortran compilers can correctly produce this
alignment on an x86 machine.

> (I wonder if all Crays obey this alignment?)

I'm pretty sure they do.  Cray architecture is designed around the
REAL*8 data type.
 
> (The g77 docs explain %VAL.)

With all this talk about standard/nonstandard coding, %VAL is a
nonstandard F77 function.  If it were universally available decades ago,
this code would not have had to play WORK(INDEX) tricks to do the same
thing.  I am not sure that using %VAL now is OK, because this could
break the code on some other machine, and besides, too much code relies
on the WORK(INDEX) mechanism.  My preference was to adjust the C
interface routine as explained in my previous message.

A compiler capable of aligning 8-byte data types on 8-byte boundaries is
desirable, as is the ability to handle the PARAMETER
(NSIZE=MAX(NTHIS,NTHAT)) statements.

Thanks again for your comments,
Josip

-- 
Dr. Josip Loncaric, Senior Staff Scientist        mailto:josip@icase.edu
ICASE, Mail Stop 403                        http://www.icase.edu/~josip/
NASA Langley Research Center             mailto:j.loncaric@larc.nasa.gov
Hampton, VA 23681-2199, USA    Tel. +1 757 864-2192  Fax +1 757 864-6134


More information about the Gcc-bugs mailing list