The evolution of compact massive quiescent and star-forming galaxies derived from the Re-Rhand Mstar-Mhrelations