  For many massive compact galaxies, their dynamical masses ($M_\mathrm{dyn}
\propto \sigma^2 r_\mathrm{e}$) are lower than their stellar masses
($M_\star$). We analyse the unphysical mass discrepancy $M_\star /
M_\mathrm{dyn} > 1$ on a stellar-mass-selected sample of early-type galaxies
($M_\star \gtrsim 10^{11} \ \mathrm{M_\odot}$) at redshifts $z \sim 0.2$ to $z
\sim 1.1$. We build stacked spectra for bins of redshift, size and stellar
mass, obtain velocity dispersions, and infer dynamical masses using the virial
relation $M_\mathrm{dyn} \equiv K \ \sigma_\mathrm{e}^2 r_\mathrm{e} / G$ with
$K = 5.0$; this assumes homology between our galaxies and nearby massive
ellipticals. Our sample is completed using literature data, including
individual objects up to $z \sim 2.5$ and a large local reference sample from
the Sloan Digital Sky Survey (SDSS). We find that, at all redshifts, the
discrepancy between $M_\star$ and $M_\mathrm{dyn}$ grows as galaxies depart
from the present-day relation between stellar mass and size: the more compact a
galaxy, the larger its $M_\star / M_\mathrm{dyn}$. Current uncertainties in
stellar masses cannot account for values of $M_\star / M_\mathrm{dyn}$ above 1.
Our results suggest that the homology hypothesis contained in the
$M_\mathrm{dyn}$ formula above breaks down for compact galaxies. We provide an
approximation to the virial coefficient $K \sim 6.0 \left[ r_\mathrm{e} /
(3.185 \ \mathrm{kpc}) \right]^{-0.81} \left[ M_\star / (10^{11} \
\mathrm{M_\odot}) \right]^{0.45}$, which solves the mass discrepancy problem. A
rough approximation to the dynamical mass is given by $M_\mathrm{dyn} \sim
\left[ \sigma_\mathrm{e} / (200 \ \mathrm{km \ s^{-1}}) \right]^{3.6} \left[
r_\mathrm{e} / (3 \ \mathrm{kpc}) \right]^{0.35} 2.1 \times 10^{11} \
\mathrm{M_\odot}$.
