The propagation of energetic ions in magnetic loops and gamma-ray emission from solar flares