Sounds like--don't laugh--constipation. It can cause some swelling, which, in turn, can affect the swim bladder messing up its equilibrium so it swims upside-down.
If you can, put a few drops of paraffin/cod liver/castor oil down his throat with an eye dropper. That usually gets 'em running pretty quick. After that, don't feed him for five days. Then only feed him veggies--such as crushed peas or algae tablets--for a while. Eventually he can go back to his normal diet.
Constipation is caused by incorrect feeding; it particularly occurs after long periods in which only dried foods or Enchytrae have been fed, If enough Daphnia, mosquito larvae, and other natural foods are given in addition, fishes will not be affected.
Another more serious complaint that may occur due to improper feeding is FDIO--Fatty Degeneration of the Internal organs--which is fatal to fish. It is caused by too many foodstuffs containing too much fat and carbohydrates in comparison to proteins are given. The disease takes a very slow course and does not show many symptoms, but it does eventually kill the fish. It is one of the most common causes of death among aquarium fish.
My point? Vary your fishes' foods!!! It is important.