chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] unused unbound variable references could be op


From: Felix
Subject: [Chicken-hackers] [PATCH] unused unbound variable references could be optimized away
Date: Fri, 07 Oct 2011 08:20:06 +0200 (CEST)

The attached patch fixes a problem in the optimizer that could cause
unbound variable references that were not used to be optimized
away, the cause being an inverted test for the '##core#always-bound
property.


cheers,
felix
commit 9c156e4e909b4617e52727013359784feb9cc059
Author: felix <address@hidden>
Date:   Fri Oct 7 08:17:54 2011 +0200

    fix test for variable being always bound before optimizing the binding away

diff --git a/compiler.scm b/compiler.scm
index fef3bb7..3b2a03b 100644
--- a/compiler.scm
+++ b/compiler.scm
@@ -2126,7 +2126,7 @@
                             (if (eq? '##core#variable (node-class value))
                                 (let ((varname (first (node-parameters 
value))))
                                   (or (not (get db varname 'global))
-                                      (not (variable-mark varname 
'##core#always-bound))))
+                                      (variable-mark varname 
'##core#always-bound)))
                                 (not (expression-has-side-effects? value db)) 
))
                        undefined) )
           (quick-put! plist 'removable #t) )

reply via email to

[Prev in Thread] Current Thread [Next in Thread]