Target control of Fortran options

Richard Biener richard.guenther@gmail.com
Thu Oct 4 08:06:00 GMT 2018


On Wed, Oct 3, 2018 at 11:04 PM Paul Koning <paulkoning@comcast.net> wrote:
>
> In the C and C++ parts of GCC, the target has some ways to adjust the compiler options depending on target settings.  I'm looking for a way to do that with gfortran.
>
> The specific issue is in pdp11, which has an option to specify that "float" is 8 bytes (same as "double") rather than 4 bytes.  And the 8 byte choice is the default.
>
> As a result, if I invoke gfortran for that target, I get an ICE because real*4 can't be found.  If I say -fdefault-real-8 it works.
>
> So what I'm hoping to do is to have the target switch processing code (for the TARGET_HANDLE_OPTION hook) react to the -mfloat32 and -mfloat64 switches by passing appropriate -fdefault-real-* switches to Fortran.  Is that possible?

I think Fortran has to do it the same way the C family does.
float/double get assigned
by looking at FLOAT_TYPE_SIZE / [LONG_]DOUBLE_TYPE_SIZE.  Iff that's not good
for the Fortran FE we'd have to define additional target hooks the FE can use.

Richard.

>         paul
>



More information about the Fortran mailing list