Stress-induced bandgap renormalization in atomic crystals