Target control of Fortran options

Paul Koning paulkoning@comcast.net
Wed Oct 3 21:04:00 GMT 2018


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?

	paul



More information about the Fortran mailing list