We study sub-Riemannian (Carnot-Caratheodory) metrics defined bynoninvolutivedistributions on real-analytic Riemannian manifolds.We establish a connection between regularity properties of thesemetrics and the lack of length minimizing abnormal geodesics.Utilizing the results of the previous study of abnormal lengthminimizers accomplished by the authors in [Annales IHP. Analysenonlinéaire 13 , p. 635-690] we describe in thispaper two classes of the germs of distributions (called2-generating and medium fat) such that the correspondingsub-Riemannian metrics are subanalytic. To characterize theseclasses of distributions we determine the dimensions of themanifolds on which generic germs of distributions of given rankare respectively 2-generating or medium fat.