From dd95c75843acd95c271bbcc3fd0f76afe1edd615 Mon Sep 17 00:00:00 2001
From: toy <toy>
Date: Fri, 5 Sep 2003 14:42:08 +0000
Subject: [PATCH] The deftransform for - with a float and complex arg was
 negating the imaginary part instead of subtracting from 0.  This is needed to
 get the correct sign if the imaginary part was 0.

(From a bug in Paul Dietz's ansi tests.)
---
 compiler/float-tran.lisp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/compiler/float-tran.lisp b/compiler/float-tran.lisp
index 49ba1a2b1..42cc8a837 100644
--- a/compiler/float-tran.lisp
+++ b/compiler/float-tran.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.91 2003/09/02 01:22:01 toy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.92 2003/09/05 14:42:08 toy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -1263,7 +1263,9 @@
 	       (deftransform - ((w z) ((complex ,type) real) *)
 		 '(complex (- (realpart w) z) (imagpart w)))
 	       (deftransform - ((z w) (real (complex ,type)) *)
-		 '(complex (- z (realpart w)) (- (imagpart w))))
+		 ;; The 0d0 for the imaginary part is needed so we get
+		 ;; the correct signed zero.
+		 '(complex (- z (realpart w)) (- 0d0 (imagpart w))))
 	       ;; Multiply and divide two complex numbers
 	       (deftransform * ((x y) ((complex ,type) (complex ,type)) *)
 		 '(let* ((rx (realpart x))
-- 
GitLab