From 97b43235a9af3d5d3f339ce0189d06d2e07b87e9 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 23 Feb 2014 17:08:55 +0000 Subject: [PATCH] Don't rewrite (flo:- 0. x) as (flo:negate x) on amd64. This is wrong because (flo:- 0. 0.) is 0. but (flo:negate 0.) is -0. This caused some broken code to be miscompiled and yield the correct result accidentally! --- src/compiler/machines/x86-64/rulrew.scm | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/compiler/machines/x86-64/rulrew.scm b/src/compiler/machines/x86-64/rulrew.scm index f785b2ce9..3838549ef 100644 --- a/src/compiler/machines/x86-64/rulrew.scm +++ b/src/compiler/machines/x86-64/rulrew.scm @@ -237,14 +237,6 @@ USA. (QUALIFIER (rtl:constant-flonum-test operand flo:nonzero?)) (rtl:make-object->float operand)) -(define-rule rewriting - (FLONUM-2-ARGS FLONUM-SUBTRACT - (REGISTER (? operand1 register-known-value)) - (? operand2) - (? overflow?)) - (QUALIFIER (rtl:constant-flonum-test operand1 flo:zero?)) - (rtl:make-flonum-1-arg 'FLONUM-NEGATE operand2 overflow?)) - (define (rtl:constant-flonum-test expression predicate) (and (rtl:object->float? expression) (let ((expression (rtl:object->float-expression expression))) -- 2.25.1