Stocks rose on Wednesday as investors remained cautiously optimistic about progress on a rescue deal for Greece.

International auditors headed to Greece to scrutinize new austerity measures they must endorse for Athens to get the next tranche of aid. Greece's parliament approved the deeply unpopular measures on Tuesday.

German Chancellor Angela Merkel suggested that parts of a planned new 109-billion-euro ($148.6 billion) rescue for the debt-laden country could be reopened, depending on the outcome of the audit.

Efforts to solidify a euro zone rescue fund and alleviate the region's sovereign debt crisis lifted stocks on Tuesday for a third consecutive session and came after four straight days of losses for the benchmark S&P 500.

At least they are doing something and for the moment it has taken away the fear of a collapse for now, said Frank Lesh, a futures analyst and broker at FuturePath Trading LLC in Chicago.

It is certainly interesting that we had that nice rally yesterday and gave it all back late afternoon, but it just shows how nervous the markets are and it is tough to commit. We will probably continue like this until there is a little more clarity -- and who knows when that comes.

Analysts also said equities would be boosted by quarter-end window dressing, when portfolio managers drop underperforming stocks and buy outperformers.

The Dow Jones industrial average gained 85.97 points, or 0.77 percent, to 11,276.66. The Standard & Poor's 500 Index gained 5.08 points, or 0.43 percent, to 1,180.46. The Nasdaq Composite Index gained 11.86 points, or 0.47 percent, to 2,558.69.

In the latest economic data, new orders for long-lasting U.S. manufactured goods slipped in August on weak demand for motor vehicles, but a rebound in a gauge of business spending suggested the economy would avoid another recession. Inc gained 3.5 percent to $231.90 as it is expected to launch its long-awaited tablet computer.

Discount chain Family Dollar Stores Inc recorded higher quarterly income. Shares rose nearly 1 percent to $54.65.

(Reporting by Chuck Mikolajczak; editing by Jeffrey Benkoe)