The $\mu(I)$-rheology has been recently proposed as a potential candidate to model the flow of frictional grains in a dense inertial regime. However, this rheology was shown to be ill-posed in the mathematical sense for a large range of parameters, notably in the slow and fast flow limits \citep{Barker2015}. In this rapid communication, we extend the stability analysis to compressible flows. We show that compressibility regularizes mostly the equations, making them well-posed for all parameters, at the condition that sufficient dissipation is associated with volume changes. In addition to the usual Coulomb shear friction coefficient $\mu$, we introduce a bulk friction coefficient $\mu_b$, associated to volume changes and show that the equations are well-posed in two dimensions if $\mu_b>2-2\mu$ ($\mu_b>3-7\mu/2$ in three dimensions). Moreover, we show that the ill-posed domain defined in \citep{Barker2015} transforms into a domain where the equations are unstable but stay well-posed when compressibility is taken into account. These results suggest thus the importance of compressibility in dense granular flows.