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]

g77s lack of context sensitive constants


I'm using g77 0.5.24, on i386, to compile a geat deal of fortran source,
which has been developed over many years on other compilers and systems.
In particular I would like to have precisise agreement between results on
DEC's f77 on an alpha and my g77 code.

I find I can achieve this, almost totaly by wraping egcs-generated fpu
instructions into subroutines (ie specifying -msoft-float and giving user
routines) which has the effect of passing and returning all FP on the cpu
stack. This nicely removes the 'problem' of added precision on 32 bit
calulations I find otherwise. The speed hit is measurable at a few % but I
can live with it. Apart from this my other major problem is g77's context
insensitive constants.

In particular much of my code assumes that if sigle precision constants
are promoted to double the decimal is extended, rather than the binary.
g77 makes a point of extending by padding with binary zeros, as this is
what is done in any case with constants declared as a parameters. While
this is very good, it leavs me with a huge job to fix my code.

I've added a warning to my g77 in case a real constant is promoted to
double - so I at least know when this happens. From my limited knowledge
of the compiler I know that it there is no way I could add context
sensitive behaviour without spending a lot of time working out how to do
it!

My question is has anybody else had to address this, and is it likely that
context sensitive constants will ever be added as an option to g77?

Thanks,
- David


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