On 08/22, Oleg Nesterov wrote:
>
> Hello,
>
> this trivial code
>
>       one = 1 : route(1,1,1,1);
>       process = route(1,1,1,one);
>
> doesn't compile. Why? Shouldn't compiler evaluate the
> ls1/ls2/lsr trees ?
>
> The change below helps, but of course it is not a proper fix.

OK, see the patch below. I believe this is the "proper" fix.

Except the declaration of simplifyingAdd() should go into some .hh file.
The obvious candidate is compiler/normalize/aterm, but then we need to
change compiler/propagate/propagate.cpp to include this file.

Perhaps this declaration can live in compiler/propagate/propagate.hh ?

Oleg.
---

diff --git a/compiler/normalize/aterm.cpp b/compiler/normalize/aterm.cpp
index 3334f58c7..0642d30c1 100644
--- a/compiler/normalize/aterm.cpp
+++ b/compiler/normalize/aterm.cpp
@@ -47,7 +47,7 @@ aterm::aterm(Tree t)
 /**
  * Add two terms trying to simplify the result
  */
-static Tree simplifyingAdd(Tree t1, Tree t2)
+Tree simplifyingAdd(Tree t1, Tree t2)
 {
     faustassert(t1);
     faustassert(t2);
diff --git a/compiler/propagate/propagate.cpp b/compiler/propagate/propagate.cpp
index 93abde239..4ceb582c3 100644
--- a/compiler/propagate/propagate.cpp
+++ b/compiler/propagate/propagate.cpp
@@ -32,6 +32,8 @@
 #include "simplify.hh"
 #include "xtended.hh"
 
+Tree simplifyingAdd(Tree t1, Tree t2);
+
 ////////////////////////////////////////////////////////////////////////
 /**
  * propagate : box listOfSignal-> listOfSignal'
@@ -537,7 +539,7 @@ static siglist realPropagate(Tree slotenv, Tree path, Tree 
box, const siglist& l
                     Tree exp = outsigs[dst - 1];
                     if ((src > 0) & (src <= ins)) {
                         // we have a source
-                        outsigs[dst - 1] = sigAdd(exp, lsig[src - 1]);
+                        outsigs[dst - 1] = simplifyingAdd(exp, lsig[src - 1]);
                     }
                 }
             }



_______________________________________________
Faudiostream-devel mailing list
Faudiostream-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-devel

Reply via email to