Read MoreTop sector still the best bet: Chartist
The CBOE Volatility Index rose for a second straight day, up 2.5 percent, though it remained under 12, well below the historical average of 20. While the level of the VIX indicates a lack of fear in the market, some investors are concerned that it also reflects a sense of complacency.
"We can't seem to get a decent pullback here as there isn't any momentum to the downside. Every time the market goes down, it is met with buying," said Peter Cardillo, chief market economist at Rockwell Global Capital in New York.
Semiconductor stocks ranked among the market's leaders, with the PHLX semiconductor index up 0.9 percent. The sector rallied after Skyworks Solutions raised its earnings and revenue outlook, driving its stock up 6 percent to $45.65. Broadcom, up 3 percent at $35.88, also gave chipmakers a lift.
Read MoreLouise Yamada: Get ready for S&P milestone—2,000
Automakers attracted attention after both General Motors and Ford Motor reported May sales that topped expectations. GM shares rose 1.1 percent to $35.26. Ford's stock gained 0.7 percent to $16.55.
Hillshire Brands shares rose 9.5 percent to $58.65 after poultry producer Pilgrim's Pride raised its offer to buy Hillshire, known for its Jimmy Dean sausages, and topped an offer from poultry rival Tyson Foods. Hillshire said it would talk with both parties.
Pilgrim's stock fell 2.2 percent to $25.34. Tyson dropped 3 percent to $42.08.
Read MoreStop worrying! The'new normal' is over: Pros
In the latest economic data, April factory orders rose 0.7 percent, topping forecasts.
Trading volume was light at around 5.1 billion shares on U.S. exchanges, below last month's average of 5.75 billion, according to data from BATS Global Markets.