Speaking personally, I am not a health expert or professional singer, and would likely fail to take some of the expert advice I am listing below (yeah, I know). Still, let's look at a few possible reasons why your stomach might hurt when you sing, and possible steps to help resolve such issues, or avoid them altogether.
Experiencing stomach pain while singing can have various causes, and it's essential to consider factors such as technique, posture, hydration, and overall health. Tension may be a big issue here. If you're tensing your abdominal muscles excessively while singing, it can lead to discomfort or pain in the stomach area. This tension might result from trying too hard to control your breath or produce sound.
Diaphragmatic control is another consideration. Proper diaphragmatic breathing is crucial for singing, but if you're not breathing correctly, it could lead to strain on your abdominal muscles and surrounding tissues, causing discomfort. You may even wish to try breathing exercises, including the "Pursed Lip Breathing Technique."
Digestive issues, dehydration, muscle strain
Stomach pain could be a result of digestive problems such as acid reflux, gastritis, or irritable bowel syndrome (IBS). These conditions might be aggravated by singing, especially if you're using your diaphragm and abdomen extensively. Dehydration may also be a culprit. Singing requires proper hydration to keep the vocal cords lubricated and the body functioning optimally. Dehydration can lead to cramping and discomfort in the stomach area.
Muscle strain might also make singing a lot trickier. Singing involves various muscles, including those in the abdomen. If you're not properly warmed up or if you're pushing your voice beyond its limits, you might strain these muscles, leading to pain. Vocal coaches on YouTube talk a lot about technique, and often warn against using improper technqiues that can cause various muscle issues (which, again, may involve the stomach).
Poor posture, stress, anxiety
Incorrect posture while singing can put pressure on the abdomen, leading to discomfort or pain.
Health experts note the following: "It's a common and important health problem among Americans, and it can lead to neck pain, back problems, and other aggravating conditions..." Make sure you're standing or sitting with proper alignment to avoid unnecessary strain on your body. Yes, this type of advice will always make kids roll their eyes and say "Whatever," but good, healthy singers do tend to have good posture (in addition to often eating healthy, and stuff like that).
Also, stress or anxiety can be a major hurdle to successful singing. Emotional tension can manifest physically, including in the form of stomach pain. An expert on The University of Chicago Medicine website notes: "When you’re stressed, the nervous system sends signals to your gut and intestines, triggering the muscles involved in digestion to go into a 'fight or flight' response. They can react by quickly pushing waste through your system, causing nausea, cramping, bloating or diarrhea."
If you're feeling nervous or anxious while singing, it could contribute to discomfort in the stomach area. Perhaps this can happen if you worry about having an imperfect voice. On that note, it may be valuable to recall the words of Giovanni Battista Lamperti, a famous Italian voice teacher: "It matters not whether your voice be phenomenal or even beautiful, if it expresses the music and the words you will have an interested audience." So, oddly enough, worrying about your singing ability can actually make you a worse, less healthy singer. So yes, maybe take the necessary steps to improve your skills as a singer, but worrying too much about how you sound probably won't actually help you in the long run, and can damage your career and your health.
Final thought on "perfect singing"
If you're experiencing persistent or severe stomach pain (or other pains) while singing, it's a good idea to consult with a medical professional or a vocal coach. They can help assess your technique, identify any underlying health issues, and provide guidance on how to alleviate discomfort and improve your singing experience. You may also wish to consider your limits, vocally.
Sure, the idea of pushing oneself beyond the limit sounds appealing, and might make you sound strong, but at what cost? If singing a certain way is too damaging for you, you should probably consider taking another, equally valuable approach, and you may still have success, just with doing things a different way. It's also worth considering that every singer (or any other musician) has probably had more than one bad gig, or bad song, or bad album. It happens!
Here is Bruce Springsteen discussing his relatively recent stomach issues:
Also, here is a classic MTV interview with Kurt Cobain of Nirvana where he talked at length about his stomach issues (though it merits a warning that he discussed depression and suicidal thoughts related to his condition). He also went on to discuss his music (obviously, his views were his own)