* TSX up 39.35 points, or 0.31 percent, at 12,931.46
* Lack of progress in U.S. debt negotiations boosts bullion, gold miners
* Lower commodity prices weigh on resource-rich Canada index
By Alastair Sharp
TORONTO, Oct 15 (Reuters) - Canada's main stock index gained on Tuesday, as shares of gold miners jumped after U.S. negotiations to avert a damaging debt default stalled.
Bullion had hit a three-month low earlier in the day as investors bet that a deal could be reached. But as negotiations sputtered ahead of a Thursday deadline, a safe-haven rally for gold in turn boosted Canada-listed gold miners.
"Many of the leading (gold mining) stocks have been beaten down beyond belief, are trading at very attractive valuations and they offer good dividend yields," said Elvis Picardo, a strategist at Global Securities in Vancouver.
The gold mining sub-index, which has declined sharply in recent months, gained more than 3 percent.
Other commodities, including oil, were lower, while the three main U.S. indices also retreated in the face of the political uncertainty.
The resource-heavy Toronto Stock Exchange's S&P/TSX composite index ended up 39.35 points, or 0.31 percent, at 12,931.46.
Picardo said the index should be well-placed to gain in the medium-term, assuming a deal is reached that avoids a U.S. default.
"Investors are just waiting for this one big uncertainty to be resolved before they jump in with both feet," he said, pointing to energy and mining stocks as likely winners.
Hopes for a deal had risen after U.S. Senate Majority Leader Harry Reid, a Democrat, and his Republican counterpart, Mitch McConnell, ended a day of talks on Monday with Reid saying they had made "tremendous progress."
"I suspect something will happen on the positive side (in U.S. fiscal negotiations) but in the meantime the market is very nervous," said Irwin Michael, portfolio manager at ABC Funds.
Barrick Gold Corp gained 3.7 percent to C$18.46, while Goldcorp Inc added 2.2 percent to C$24.97.
Pipeline operator Enbridge Inc declined 1 percent to C$42.55, while Talisman Energy Inc fell 1.5 percent to C$12.52.
BlackBerry Ltd gained 1.8 percent to C$8.50. The struggling smartphone company on Tuesday issued an open letter in newspapers to its customers and partners in a bid to reassure them.