Changeset 15512 in project


Ignore:
Timestamp:
08/17/09 23:13:19 (10 years ago)
Author:
felix winkelmann
Message:

inlining in local mode didn't treat multiply assigned global as unkown

Location:
chicken/branches/inlining
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/inlining/compiler.scm

    r15495 r15512  
    18321832      (cond ((eq? '##core#undefined (node-class val))
    18331833             (put! db var 'undefined #t) )
    1834             ((and (eq? '##core#variable (node-class val))
     1834            ((and (eq? '##core#variable (node-class val)) ; assignment to itself
    18351835                  (eq? var (first (node-parameters val))) ) )
    18361836            ((or (memq var env)
     
    18491849                  (not (get db var 'unknown)))
    18501850             (let ((home (get db var 'home)))
    1851                (if (or (not home) (eq? here home))
    1852                    (put! db var 'local-value val)             
    1853                    (put! db var 'unknown #t))))
     1851               (cond ((get db var 'local-value)
     1852                      (put! db var 'unknown #t))
     1853                     ((or (not home) (eq? here home))
     1854                      (put! db var 'local-value val)           )
     1855                     (else (put! db var 'unknown #t)))))
    18541856            (else (put! db var 'unknown #t)) ) )
    18551857   
     
    19151917
    19161918         (set! value (and (not unknown) value))
     1919         (set! local-value (and (not unknown) local-value))
    19171920
    19181921         ;; If this is the first analysis, register known local or potentially known global lambda-value id's
  • chicken/branches/inlining/tests/inlining-tests.scm

    r15502 r15512  
    1717(assert (eq? #t (foo '(abc))))
    1818
     19
     20;;; SVN rev. 15511: multiple assignments didn't make global variable unknown for local inlining
     21
     22(define (bar)
     23  (set! foo (lambda () 1)))
     24
     25(define (foo) 0)
     26(bar)
     27(assert (= 1 (foo)))
Note: See TracChangeset for help on using the changeset viewer.