The S&P 500 posted gains for the fifth consecutive day, briefly crossing the 4,500-point threshold for the first time on Wednesday.