Generation of CO2-rich melts during basalt magma ascent and degassing