This is the mail archive of the gcc-bugs@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: g77 alignment bug (egcs-1.1.1)


>>>>> "JL" == Josip Loncaric <josip@icase.edu> writes:

 JL> In compiling a CFD code, we found that the egcs-1.1.1 version of
 JL> g77 does not produce properly aligned REAL*8 arrays.

Why would that be a bug in general?  It might be on SPARC, for
instance, but AFAIK it aligns doubles on SPARC unless told otherwise.

 JL> This really messes up things in computing the offset index to a
 JL> malloc()'d workspace which is correctly 8-byte aligned.

Sorry, I don't understand at all.  (If you're trying to expose malloc
to Fortran, the first advice is don't, and the second is that many
bets are off.  Use automatic arrays if possible.)

 JL> This bug is dependent on compiler optimization switches (e.g. the
 JL> problem seen with FOPTS="-O -malign-double" went away with
 JL> FOPTS="-O -malign-double -fomit-frame-pointer").

AFAIR, -malign-double is only relevant for x86, and then only for
non-stack-allocated data, i.e. SAVEd, COMMON, and EQUIVALENCE (?).
egcs 1.1 should double-align SAVEd doubles on x86 regardless.  See the
manual index.  Are you specifically talking about x86?


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