Regularity of solutions to a time-fractional diffusion equation