Stocks rose on Tuesday on optimism the Greek parliament would adopt an unpopular austerity plan, easing concerns about a default, and as the pace of decline in U.S. home prices moderated.

The S&P energy index <.GSPE> surged nearly 2 percent, the biggest gainer among S&P sectors, as crude oil futures rose on bets the Greece measures would be passed. Halliburton Co gained 3.2 percent to $47.70, while Chevron Corp was up 1.4 percent at $100.29.

For the past several weeks, the overhang on the market is how this will play out, and now there's a realization that Greece will come to a resolution, said David Kotok, chief investment officer at Cumberland Advisors in Sarasota, Florida. The markets like that we're shedding that uncertainty and are finding legs.

Greek lawmakers will vote Wednesday and Thursday on the measures, which must be passed in order to receive the next payment of its bailout. If the government doesn't get the next tranche, it could spark a Europe-wide crisis and potential credit market freeze.

In a sign of stabilization in the housing market, U.S. single-family home prices dipped modestly in April, at the start of the spring buying season, according to the S&P/Case-Shiller index.

Any evidence housing is improving or that stabilization is increasing is a very strong positive sign, Kotok said.

The Dow Jones industrial average <.DJI> was up 90.86 points, or 0.75 percent, at 12,134.42. The Standard & Poor's 500 Index <.SPX> was up 9.16 points, or 0.72 percent, at 1,289.26. The Nasdaq Composite Index <.IXIC> was up 20.26 points, or 0.75 percent, at 2,708.54.

U.S. consumer confidence fell more than expected in June to the lowest point since November 2010 on concerns about the slack labor market and sputtering recovery.

Nike Inc surged 7.6 percent to $87.84 a day after reporting fourth-quarter earnings that beat expectations, while orders suggested robust strength for the future.

Concerns about a possible Greece default have contributed to S&P losses of more than 5 percent since the start of May. Some traders are using the recent weakness as an opportunity to buy beaten-down shares.

(Editing by Jeffrey Benkoe)