US stocks end with gains after Fed cuts rates again