For Riemannian manifolds with a smooth measure $(M, g, e^{-f}dv_{g})$, we prove a generalized Myers compactness theorem when Bakry--Emery Ricci tensor is bounded from below and $f$ is bounded.