Skip to content

Commit

Permalink
fix #37677, unreliable lowering of assignments to gensym'd names (#37717
Browse files Browse the repository at this point in the history
)
  • Loading branch information
JeffBezanson committed Sep 25, 2020
1 parent 3b55dae commit 2479691
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/ast.scm
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,6 @@
(define (reset-gensyms)
(set! *current-gensyms* *gensyms*))

(define (some-gensym? x)
(or (gensym? x) (memq x *gensyms*)))

(define make-ssavalue
(let ((ssavalue-counter 0))
(lambda ()
Expand Down
9 changes: 6 additions & 3 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,9 @@
(loop (cdr lhss)
(cons L assigned)
(cdr rhss)
(cons (make-assignment temp R) stmts)
(if (symbol? temp)
(list* (make-assignment temp R) `(local-def ,temp) stmts)
(cons (make-assignment temp R) stmts))
(cons (make-assignment L temp) after)
(cons temp elts)))))))))

Expand All @@ -1468,6 +1470,7 @@
;; issue #22032
(let ((temp (gensy)))
`(block
(local-def ,temp)
(= ,temp (call (core getfield) ,t ,i))
(= ,(car lhs) ,temp)))
`(= ,(car lhs)
Expand Down Expand Up @@ -1664,6 +1667,7 @@
,body))
`(scope-block ,body))))
`(block (= ,coll ,(car itrs))
(local ,next)
(= ,next (call (top iterate) ,coll))
;; TODO avoid `local declared twice` error from this
;;,@(if outer `((local ,lhs)) '())
Expand Down Expand Up @@ -2694,8 +2698,7 @@
(implicit-globals (if toplevel? nonloc-assigned '()))
(implicit-locals
(filter (if toplevel?
;; make only assigned gensyms implicitly local at top level
some-gensym?
(lambda (v) #f) ;; no implicit locals at top level
(lambda (v) (and (memq (var-kind v scope #t) '(none static-parameter))
(not (and soft?
(or (memq v (scope:implicit-globals scope))
Expand Down

2 comments on commit 2479691

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.