How does a target make Fortran work?

Paul Koning paulkoning@comcast.net
Thu Jul 12 19:22:00 GMT 2018


I tried to rebuild for target pdp11 with fortran enabled (in the past I've just enabled C).  It builds fine but the resulting compiler crashes at startup:

Paul-Konings-MacBook-Pro:gcc pkoning$ ./xgcc -B. -O2 -S ../../hello.f
f951: internal compiler error: gfc_validate_kind(): Got bad kind
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.

"hello.f" is the typical "hello world" program.  Some debugging got me to here:

* thread #1, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x00000001001c1c93 f951`gfc_init_kinds() [inlined] gfc_validate_kind(type=BT_REAL, kind=<unavailable>, may_fail=false) at trans-types.c:814 [opt]
   811 	    }
   812 	
   813 	  if (rc < 0 && !may_fail)
-> 814 	    gfc_internal_error ("gfc_validate_kind(): Got bad kind");
   815 	
   816 	  return rc;
   817 	}
Target 0: (f951) stopped.

So it's unhappy about some "kind", for BT_REAL.  I'm not sure what that means.  Is it mapping the available data types to Fortran "KIND" values?  If so, is there something the target has to do for this to work?  Note that this isn't an IEEE target, so if the initialization is expecting IEEE float then that may account for it.  But I have no idea what to do here, and the manual offers no clue.

	paul



More information about the Gcc mailing list