Gains in the three major U.S. stock indices continued to widen, with the S&P 500 and the Dow Jones Industrial Average both hitting record highs.