No, in the military, rifles and pistols are never called guns -- they're called rifles, pistols, or (more commonly) weapons.
"Gun" strictly refers to a crew-served weapon like a machine gun or a hozitzer, and new recruits are mocked heavily if they screw up and refer to their personal weapon as a gun.
(You learn this the first day at basic training -- and reporters are constantly giving away their lack of military knowledge by making this very common mistake.)
Sgt. Hartman: "This is my rifle! This is my gun!"