Stocks cut gains on Tuesday following cautious comments from Federal Reserve chairman Ben Bernanke on the economy's prospects and a report that showed further deterioration in housing.

Even so, a search for-beaten down shares underpinned the market a day after Wall Street slid to a 12-year low. Major indexes had risen more than 1 percent.

The Dow Jones industrial average <.DJI> gained 39.99 points, or 0.59 percent, to 6,803.28. The Standard & Poor's 500 Index <.SPX> added 5.45 points, or 0.78 percent, to 706.27. The Nasdaq Composite Index <.IXIC> rose 12.20 points, or 0.92 percent, to 1,335.05.

(Reporting by Rodrigo Campos; Editing by James Dalgleish)