Thermal treatment for modifying the properties of semiconductor bodies