guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, wip-cps-bis, updated. v2.1.0-209-gd31e


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, wip-cps-bis, updated. v2.1.0-209-gd31e3ea
Date: Sun, 18 Aug 2013 08:24:45 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=d31e3ea66e6ce5a072684eb527e3a91dca74cfbd

The branch, wip-cps-bis has been updated
       via  d31e3ea66e6ce5a072684eb527e3a91dca74cfbd (commit)
      from  3f72a53948b536a61203d03d8de7a5eaa71a7f79 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d31e3ea66e6ce5a072684eb527e3a91dca74cfbd
Author: Andy Wingo <address@hidden>
Date:   Sun Aug 18 10:24:27 2013 +0200

    fix dfg for find-defining-expression of return values from calls
    
    * module/language/cps/dfg.scm (find-defining-expression): Variables can
      be defined by call returns, in which case there is a defining term but
      not a defining expression.
    
    * test-suite/tests/rtl-compilation.test ("values context"): Add a test.
      Doesn't trigger this bug, but it is a nice test :)

-----------------------------------------------------------------------

Summary of changes:
 module/language/cps/dfg.scm           |    6 ++++--
 test-suite/tests/rtl-compilation.test |   10 ++++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/module/language/cps/dfg.scm b/module/language/cps/dfg.scm
index 97c12aa..1a0a3ea 100644
--- a/module/language/cps/dfg.scm
+++ b/module/language/cps/dfg.scm
@@ -255,8 +255,10 @@
   (call-expression (find-call term)))
 
 (define (find-defining-expression sym dfg)
-  (and=> (find-defining-term sym dfg)
-         find-expression))
+  (match (find-defining-term sym dfg)
+    (#f #f)
+    (($ $ktrunc) #f)
+    (term (find-expression term))))
 
 (define (find-constant-value sym dfg)
   (match (find-defining-expression sym dfg)
diff --git a/test-suite/tests/rtl-compilation.test 
b/test-suite/tests/rtl-compilation.test
index 0ff7b3f..634e0f9 100644
--- a/test-suite/tests/rtl-compilation.test
+++ b/test-suite/tests/rtl-compilation.test
@@ -130,8 +130,14 @@
   )
 
 (with-test-prefix "values context"
-  1
-  )
+  (pass-if-equal '(3 . 1)
+      (run-rtl
+       '(let ((rat (lambda (n d)
+                     (call-with-values
+                         (lambda () (floor/ n d))
+                       (lambda (q r)
+                         (cons q r))))))
+          (rat 10 3)))))
 
 (with-test-prefix "mixed contexts"
   (pass-if-equal "sequences" '(3 4 5)


hooks/post-receive
-- 
GNU Guile



reply via email to

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