I did some searching and can't come up with a definite answer to this but here are some of my just general thoughts. I believe the reason that painkillers cause stomach issues is that they irritate the lining of the stomach. This is why it helps to take them with food.
So, once they are in the breastmilk I would assume that they would not have the same effect on a baby's stomach.
I did find a list of medications that have been classified by the American Academy of Pediatrics according to their safety for breastfeeding.
http://www.kellymom.com/health/meds/aap-approved-meds.html
I used to keep a list like this with me if I ever went to a doctor.
Interestingly, I also remember hearing once that ibuprofen gets into breastmilk less than tylenol. I did a quick search on this and found an abstract of research that showed that in women taking 400 mg of ibuprofen every 6 hours for 24 hours total, the researchers were unable to detect any of the medicine in the breastmilk.
http://www.ncbi.nlm.nih.gov/pubmed/6720796
Finally, the research has shown that in babies with reflux that breastfeeding is generally helpful for the baby.
Best of Luck - Stephanie
Important:
We hope you find this general health information helpful. Please note however, that this Q&A is meant to support not replace the professional medical advice you receive from your doctor. No information in the Answers above is intended to diagnose or treat any condition. The views expressed in the Answers above belong to the individuals who posted them and do not necessarily reflect the views of Remedy Health Media. Remedy Health Media does not review or edit content posted by our community members, but reserves the right to remove any material it deems inappropriate.