Welcome to Healing Well
If you have had problems with pasta before, it could be that. Sweetcorn isn't digested, it comes out the other end!
If you are constipated, have you tried any stool softener or laxative? Do you take anything normally for your IBS?
If the pain continues, you should see your doctor. The pain could be from the constipation.