I've heard it can damage the stomach lining if taken at the wrong time relative to eating. But yeah probably still the least-bad first-resort painkiller.
I didn't know about this and got a nasty ulcer after taking ibuprofen for 6 days in a row while dealing with a disease. I'm not touching this anymore and stick with a max of 2g of acetaminophen per day if I need painkillers