Re: [Rd] loop compilation problem

2017-08-30 Thread luke-tierney
What is happening here is that the compiler makes a legitimate optimization, but that runs into a long-standing issue, not related to compilation, with certain assignment expressions in arguments. The general issue will take some time to address; hopefully it will be resolved in time for the next

Re: [Rd] loop compilation problem

2017-08-24 Thread luke-tierney
Thanks. Here is a simplified version: library(compiler) zero <- 0 one <- 1 expr <- quote((z <- zero + one) + (z <- z + 1)) eval(compiler::compile(expr)) Sill fix shortly. Best, luke On Thu, 24 Aug 2017, Lukas Stadler wrote: Hi! We’ve seen a problem with the compiler in specific cases of m

[Rd] loop compilation problem

2017-08-24 Thread Lukas Stadler
Hi! We’ve seen a problem with the compiler in specific cases of matrix updates: > { m <- matrix(1:4, 2) ; z <- 0; for(i in 1) { m[z <- z + 1,z <- z + 1] <- 99; > } ; m } [,1] [,2] [1,]13 [2,]2 99 Here, it modifies element [2,2], which is unexpected. It behaves correct without