If the bowel is irritated you get a thing called inflammation, which does not cause foul smelling gas or stool. You can also get diarrhea, which also does not cause foul smelling gas or stool.
Foul smelling gas and stools comes primarily from the production of hydrogen sulfide, other sulfur compounds and/or ammonia compounds in the intestines. Hydrogen sulfide is generated by bacteria we want to keep under control with our "good flora" such as Lactobacillus and Bifidus bacteria. The "bad" bacteria that generate the hydrogen sulfide gas include Salmonella enterica and Escherichia coli. Actually E. coli is really not all all bad. It does generate vitamin K for the body.
The sulfur compounds and ammonia are generated by anaerobic bacteria in the intestines. Our "good flora" again help to control the anaerobic microbes that lead to the production of the sulfur and ammonia compounds generated from amino acid breakdown. In addition the acids formed from our "good flora" can help neutralize the ammonia.