using FFTW, LinearAlgebra
A = rand(Float32, 16, 16)
p = plan_rfft(data)
pinv = plan_irfft(p * A, size(data, 1))
B = p * A
B0 = copy(B)
# This should NOT modify B but does
mul!(similar(A), pinv, B)
# Check
println("Buffer modified: ", !(B ≈ B0))
I guess this occurs for performance reasons, but this unexpected corruption prevents from reusing B (without a new allocation).