~ chicken-core (chicken-5) d8727f4a9bdfded30813a5a433b57eddf60c068f


commit d8727f4a9bdfded30813a5a433b57eddf60c068f
Author:     megane <meganeka@gmail.com>
AuthorDate: Mon Sep 16 12:04:49 2019 +0300
Commit:     Peter Bex <peter@more-magic.net>
CommitDate: Tue Sep 17 18:46:58 2019 +0200

    Revert half of "Add some optimizer simplification rules"
    
    This causes uri-generic to fail to compile in similar way #1648 does.
    
    Signed-off-by: Peter Bex <peter@more-magic.net>

diff --git a/optimizer.scm b/optimizer.scm
index fc2d3165..bd163710 100644
--- a/optimizer.scm
+++ b/optimizer.scm
@@ -830,38 +830,6 @@
                                    args1)
                                  nargs)
                            #t))
-                    (else (loop (cdr args)
-                                (cons (car args) nargs)
-                                ok)))))))
-
- ;; (let ((<var1> (##core#inline <op> ...)))
- ;;   (<var2> ... <var1> ...))
- ;; -> (<var2> ... (##core#inline <op> ...) ...)
- ;;                                  ...))
- ;; - <var1> is used only once.
- `((let (var) (##core#inline (op) . args1)
-      (##core#call p . args2))
-    (var op args1 p args2)
-    ,(lambda (db may-rewrite var op args1 p args2)
-       (and may-rewrite   ; give other optimizations a chance first
-            (= 1 (length (db-get-list db var 'references)))
-            (let loop ((args args2) (nargs '()) (ok #f))
-              (cond ((null? args)
-                     (and ok
-                          (make-node 
-                           '##core#call p
-                           (reverse nargs))))
-                    ((and (eq? '##core#variable
-                               (node-class (car args)))
-                          (eq? var
-                               (car (node-parameters (car args)))))
-                     (loop (cdr args)
-                           (cons (make-node
-                                   '##core#inline
-                                   (list op)
-                                   args1)
-                                 nargs)
-                           #t))
                     (else (loop (cdr args)
                                 (cons (car args) nargs)
                                 ok))))))))
Trap