[PATCH] F77 on sparc64-*-*
Jeffrey A Law
law@cygnus.com
Mon Dec 13 19:36:00 GMT 1999
In message <199912132202.OAA21652@cygnus.com>you write:
> Jakub wrote:
>
> Seems like f/ needs the same handling on sparc64 like it has been done for
> alpha, otherwise f771 aborts even on -v.
> We have FLOAT_TYPE_SIZE 32 and Fortran wants to have ffetargetInteger1 as
> large as float type.
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> Hmmmm, yes, I see why you need this, although I'm not particularly thrilled
> by this "solution"/
>
> 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.
>
> It would probably be better if it simply used `int' instead of `long int'
> to enforce that, but on the other hand, the real (:-) solution might be
> to have the Frontend interrogate the backend about the sizes of SImode,
> DImode and SFmode, DFmode.
The way the Fortran front-end has dealt with types has always been rather
broken. This is just one example. Another is dealing with targets where the
basic data types change based on runtime flags.
Does the rule mandate that DOUBLE be twice a REAL? What about targets where
that isn't actually possible? :-)
Anyway, it's not a matter of querying the backend about the sizes of the
modes, but instead starting with a sane value (word_mode) for REAL, INTEGER and
LOGICAL, then iterating through the higher numbered modes until you find one
that is 2X that size. Then see if the backend can support the 2X mode. If
it can't, then start with word_mode / 2 and retry. Iterate until you abort :-)
That's working from the assumption that you want REAL, INTEGER & LOGICALS to
default to the natural word size of the target. The other approach is to start
with SImode and use the same algorithm.
Note this needs to be compile-time selectable since word_size and such can
change based on compiler switches.
One of the things we need to make sure get fixed for g95.
jeff
More information about the Gcc
mailing list