Calculation of infrared-divergent Feynman diagrams with zero mass threshold