From: Taylor R Campbell Date: Sun, 23 Feb 2014 17:08:55 +0000 (+0000) Subject: Don't rewrite (flo:- 0. x) as (flo:negate x) on amd64. X-Git-Tag: release-9.2.0~36 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=97b43235a9af3d5d3f339ce0189d06d2e07b87e9;p=mit-scheme.git 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! --- 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)))