From 02d7e794464f3a27ae66e5cf84816bb6206a9afc Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 2 Nov 2021 07:12:51 -0700 Subject: compiler: bug: invalid transformation of (- x y ...). * stdlib/compiler.tl (compiler comp-arith-neg-form): Remove algebraically incorrect transformation. --- stdlib/compiler.tl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl index ae64266b..5330161d 100644 --- a/stdlib/compiler.tl +++ b/stdlib/compiler.tl @@ -1265,12 +1265,8 @@ (tree-bind (nop . args) form (let ((op (caseq nop (- '+) (/ '*))) (a1 (car args))) - (if (and (eq nop '-) - (constantp a1)) - me.(comp-arith-form oreg env - ^(,op (- ,a1) ,*(cdr args))) - me.(comp-fun-form oreg env - ^(,nop ,(car args) (,op ,*(cdr args))))))) + me.(comp-fun-form oreg env + ^(,nop ,(car args) (,op ,*(cdr args)))))) me.(comp-fun-form oreg env form))) (defmeth compiler comp-fun-form (me oreg env form) -- cgit v1.2.3