>> Are you proposing that in the presence of checking that >> the frontend should emit a new function such that >> >> x = reshape(y,z) >> >> becomes >> >> check_bounds(x, y, z) >> x = reshape(y,z) > Yes; using tree-ssa to accomplish it. This is probably the best way to do it, so go for it! FX