From d8d2f45516f519ccd02d61d583a4739968a98f7d Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Tue, 17 Jan 2006 18:00:33 +0000
Subject: [PATCH] INTERVAL-MERGE-PAIR was incorrectly merging the interval
 [-0.0, -0.0] with [0.0, 0.0] to produce [-0.0,-0.0].  The correct answer is
 [-0.0,0.0].  This bug was reported by Mika Pihlajamaki, cmucl-imp, Dec 28,
 2005.

A simple test case is

(defun foo2b ()
  (* 0
     (+ (if (< 1 1)
	    1
	    1)
	3.14)))
---
 compiler/srctran.lisp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/compiler/srctran.lisp b/compiler/srctran.lisp
index 432f7a37b..adec075b9 100644
--- a/compiler/srctran.lisp
+++ b/compiler/srctran.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/srctran.lisp,v 1.160 2005/07/26 12:34:51 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.161 2006/01/17 18:00:33 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -666,8 +666,10 @@
 	     (x-hi (copy-interval-limit (interval-high x)))
 	     (y-lo (copy-interval-limit (interval-low y)))
 	     (y-hi (copy-interval-limit (interval-high y))))
-	(make-interval :low (select-bound x-lo y-lo #'< #'>)
-		       :high (select-bound x-hi y-hi #'> #'<))))))
+	(make-interval :low (select-bound x-lo y-lo
+					  #'signed-zero-< #'signed-zero->)
+		       :high (select-bound x-hi y-hi
+					   #'signed-zero-> #'signed-zero-<))))))
 
 ;; Wrap a handler-case around BODY so that any errors in the body
 ;; will return a doubly-infinite interval.
-- 
GitLab