Phase separation and superconductivity