Stocks were little changed on Tuesday as data suggesting no let-up in the housing slump tempered investors' hopes that the recession was moderating.

U.S. housing starts and permits fell unexpectedly to record lows in April, according to a government report.

Additionally, the chief executive of Home Depot Inc , the largest U.S. home improvement chain, said he was concerned about accelerating rates of foreclosures, especially in the Western United States.

Before the bell, Home Depot posted a stronger-than-expected quarterly profit, but its shares reversed some gains from the prior session, falling 4 percent.

Analysts said while the housing data pointed to more headwinds in the sector, less new construction should bode well for the market in the long run as home inventories fall.

I view the collapse in construction as good news, said Jack Ablin, chief investment officer at Harris Private Bank in Chicago. The fact that we are cutting off new supply will go a long way to really see an equilibrium much faster in residential real estate.

The Dow Jones industrial average <.DJI> gained 20.63 points, or 0.24 percent, to 8,524.71. The Standard & Poor's 500 Index <.SPX> rose 3.83 points, or 0.42 percent, to 913.54. The Nasdaq Composite Index <.IXIC> climbed 2.45 points, or 0.14 percent, to 1,734.81.

Home Depot shares dropped $1.04 to $24.99, and the stock was the Dow's top drag, ahead of 3M Co , which slid 0.39 percent to $59.

Shares of American Express Co fell 1 percent to $25.86, a day after the credit card company said it will cut 4,000 jobs, or 6 percent of its workforce, as it grapples with rising customer defaults.

But defensive stocks of companies seen as better able to withstand an uncertain economy headed higher. Procter & Gamble Co

, a maker of Pampers diapers and Crest toothpaste, rose 1.1 percent to $53.10.

In banking news, JPMorgan Chase & Co Chief Executive Jamie Dimon said the No. 2 U.S. bank expected to repay some government bailout money in a couple of weeks.

The news briefly sent bank stocks higher, but by midday they had reversed to trade near break-even.

(Reporting by Ellis Mnyandu; additional reporting by Edward Krudy; editing by Jeffrey Benkoe)