US stocks rebound, lifting S&P 500 to fresh record