A standard AR (or military M4) carbine is 7"+/- from the front of the upper receiver to the rear of the front sight base. Hence, the Daniel Defense, Larue Tactical, and other makers "7.0" rail for standard AR carbines.
A midlength gas system pushes the front sight base out another 2"+/-. Hence the "9.0" rails from Daniel Defense, Larue Tactical, etc.
Having a 7" barrel on a 9" gas system would be a little difficult. In fact, having a 7" barrel on a 7" gas system would be kind of tough as well. Most 7" barrels push the gas block back to somewhere in the neighborhood of 4-5" from the front of the upper.

