It is a very bad idea to possess a firearm while robbing a bank, committing any federal crime of violence, or trafficking drugs. Congress has imposed stiff, sometimes unconsciounable penalties for doing so. These include mandatory minimums that, with multiple offenses, could get your mandatory minimum sentence into centuries of years in the penitentiary.
18 U.S.C. section 924(c) (1) (A) states that
“(A) Except to the extent that a greater minimum sentence is otherwise provided by this subsection or by any other provision of law, any person who, during and in relation to any crime of violence or drug trafficking crime (including a crime of violence or drug trafficking crime that provides for an enhanced punishment if committed by the use of a deadly or dangerous weapon or device) for which the person may be prosecuted in a court of the United States, uses or carries a firearm, or who, in furtherance of any such crime, possesses a firearm, shall, in addition to the punishment provided for such crime of violence or drug trafficking crime—
(i) be sentenced to a term of imprisonment of not less than 5 years; (ii) if the firearm is brandished, be sentenced to a term of imprisonment of not less than 7 years; and
(iii) if the firearm is discharged, be sentenced to a term of imprisonment of not less than 10 years. (B) If the firearm possessed by a person convicted of a violation of this subsection—
(i) is a short-barreled rifle, short-barreled shotgun, or semiautomatic assault weapon, the person shall be sentenced to a term of imprisonment of not less than 10 years; or
(ii) is a machinegun or a destructive device, or is equipped with a firearm silencer or firearm muffler, the person shall be sentenced to a term of imprisonment of not less than 30 years.”