Stocks rebounded from a downbeat start Tuesday, building on small gains for the third day in a row.
News that U.S. consumer prices jumped sharply in May drove up long-term interest rates, setting the stage for the turnaround as investors bid up shares in financial stocks such as E-Trade Financial, Charles Schwab and Goldman Sachs.
Disappointing home construction data had weighed on the market early on, sending homebuilder stocks lower.
The major stock indexes recovered, but only barely above the previous day's close.
"The market is just kind of drifting along. Everybody is trying to figure out how much of a hold this economic expansion can get, if we can get some self-sustaining momentum going," said Brad Sorensen, director of market and sector analysis at the Schwab Center for Financial Research.
Investors may get a better sense of that on Wednesday afternoon, when the Federal Reserve is scheduled to give an update following a two-day meeting of its policy-making committee.
Fed officials are widely expected to keep a key short-term rate near zero. The Fed will also update its economic forecasts.
"We're all waiting to see what the Fed has to say tomorrow," said JJ Kinahan, chief strategist at TD Ameritrade.
The Standard & Poor's 500 index rose 4.21 points, or 0.2 percent, to 1,941.99. The index is down less than 1 percent from its most recent all-time high of 1,951.27 set last week.
Five of the 10 sectors in the S&P 500 rose, led by financials. Utilities fell the most.
The Dow Jones industrial average added 27.48 points, or 0.2 percent, to 16,808.49. The Nasdaq composite gained 16.13 points, or 0.4 percent, to 4,337.23.
The three stock indexes are all up for the year.
Stocks were down slightly in premarket trading Tuesday as investors got a look at the latest data on U.S. home construction. The Commerce Department reported that homebuilders broke ground on new apartments and houses at an annual rate of 1.01 million homes in May. That's down 6.5 percent from the previous month.