US stocks end with gains on increased Fed rate cut hopes