From 2482e5f062bec0a3d18ea658f1645ad18829ff2b Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Sat, 3 Sep 2016 10:55:25 -0700
Subject: [PATCH] Fix #28: Recursive function definition in cross-compile

The recursive definition comes from %single-float and %double-float
trying to coerce a double-double-float to a single or double.  Not
sure the best place to fix this, but added a special case here for
%single-float and %double-float to convert the double-double-float to
a double that can then be coerced to the appropriate type.  (Could
have added a deftransform for coerce to handle double-doubles, but
doing it here makes it easier to follow the code.)

Verified that x86->x86 and sparc->sparc cross-compiles no longer have
the warning.  Also verified that sparc->sparc actually cross-compiles
and loads successfully and that the result will compile itself
successfully.
---
 src/code/float.lisp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/code/float.lisp b/src/code/float.lisp
index 3ac65127e..ee6e57952 100644
--- a/src/code/float.lisp
+++ b/src/code/float.lisp
@@ -1047,9 +1047,13 @@
 		(number-dispatch ((x real))
 		  (((foreach single-float double-float
 			     #+long-float long-float
-			     #+double-double double-double-float
 			     fixnum))
 		   (coerce x ',type))
+		  #+double-double
+		  ((double-double-float)
+		   (coerce (+ (double-double-hi x)
+			      (double-double-lo x))
+			   ',type))
 		  ((bignum)
 		   (bignum-to-float x ',type))
 		  ((ratio)
-- 
GitLab