All materials, whether solid, liquid or gas, change temperature when compressed or expanded. In solids, stresses cause small temperature changes described by the thermoelastic equation.