[rfc] Don't convert to/from an illegal FP type

Mark Kettenis kettenis@wins.uva.nl
Mon May 29 08:24:00 GMT 2000


   Date: Mon, 29 May 2000 23:14:11 +1000
   From: Andrew Cagney <ac131313@cygnus.com>

   Hello,

   Really wierd one - freebsd x d10v started having regressions in the
   fortran part of the testsuite.  Turns out that there were two problems:

	   o	d10v didn't correctly specify
		   TARGET_LONG_DOUBLE_FORMAT

	   o	fbsd didn't specify
		   HOST_LONG_DOUBLE_FORMAT

   the double negative ended up with a positive - d10v's floating point
   appeared to work perfectly :-)

   The attatched makes findvar.c's FP conversions more robust.  I'll follow
   with a d10v fix.

   Mon May 29 23:08:26 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	   * findvar.c (store_floating, extract_floating): Check that the
	   target floating point type is valid before converting from it.


Andrew, have you seen the following comment in defs.h:

/* This is used to indicate that we don't know the format of the floating point
   number.  Typically, this is useful for native ports, where the actual format
   is irrelevant, since no conversions will be taking place.  */

extern const struct floatformat floatformat_unknown;

Most i386 targets set TARGET_LONG_DOUBLE_FORMAT to the real format now
regardless whether they're used as part of a native port, which means
that this convention isn't very useful anymore.  But your change kills
the convention for the whole of GDB.  That may actually be a good
thing (since right now cross-debuggers might think host and target
`long double' formats are identical when they're not), but it might
also cause some regressions (i.e. on native ports that support `long
double' but don't explicitly specify the format).

Mark


More information about the Gdb-patches mailing list