* TSX ends with small gain as energy shares strengthen
* U.S. looks near final deal on bailout proposal
* Shares of gold producers fall along with bullion price (Adds details, quotes)
By Leah Schnurr
TORONTO, Sept 25 (Reuters) - The Toronto Stock Exchange's main index edged higher on Thursday as optimism that the U.S. Congress was close to agreement on a rescue plan for the financial sector pushed oils and financials higher, offseting sagging gold issues.
Financial shares climbed 1.5 percent, with Canadian Imperial Bank of Commerce (CM.TO) up 2.7 percent at C$64.00.
The heavyweight energy sector also helped lift the market, taking its cue from oil prices, which also rose on hopes for the U.S. bailout. Canadian Natural Resources (CNQ.TO) was up 2.4 percent at C$84.15, while the group rose 1.5 percent.
"We're still going through the obligatory political posturing by the various politicians there until they finally decide that they're going to write this thing into law," said Lex Kerkovius, senior research analyst at McLean & Partners Wealth Management Ltd in Calgary, Alberta.
"The general undertone right now ... is that this has got to be done because if you don't do it, we're dead," he added. For stories on bailout see [ID:nN13574113].
After another choppy session, the S&P/TSX composite index .GSPTSE closed up 33.15 points, or 0.26 percent, at 12,546.51 with seven of its 10 main sectors higher.
On the downside, the gold subindex lost 4.5 percent, pressuring the larger materials sector as the price of bullion fell. Goldcorp (G.TO) dropped 6.2 percent to C$35.60, while Barrick Gold (ABX.TO) slid 5.6 percent to C$37.70. The materials group as a whole fell 3.6 percent.
In the tech sector, MacDonald, Dettwiler and Associates (MDA.TO) tumbled after it warned late on Wednesday that a downturn in the British housing market would hurt its third-quarter profit. MDA was down 16.2 percent at C$23.00. See: [nN25507419].
In results released after the bell, BlackBerry maker Research In Motion RIM.TO reported a sharply higher profit but its forecast for the next quarter disappointed investors, sending its shares down more than 15 percent in after-hours trading in New York.
RIM was little changed during the day on the Toronto market, closing up 0.6 percent at C$101.00.
In see-saw action, the TSX index moved in a range of almost 200 points from peak to trough as investors continued to await resolution of the U.S. bailout, designed to help thaw the credit crunch.
Kerkovius said that he expects to see to see a significant rally once the proposal is approved.
"The chatter on the Street right now is that it should be fairly significant -- a lot more than we're seeing at the moment -- and it probably will sustain itself for some period of time," he said.
Market volume was 453 million shares worth C$7.9 billion. Decliners outpaced advancers 852 to 696. The blue chip S&P/TSX 60 index .TSE60 closed up 3.13 points, or 0.42 percent, at 754.78.
In New York, stocks jumped on optimism the bill will be passed soon, sending the Dow Jones industrial average .DJI up 196.89 points, or 1.82 percent, at 11,022.06. The Nasdaq Composite Index .IXIC rose 30.89 points, or 1.43 percent, to 2,186.57.
$1=$1.03 Canadian Editing by Rob Wilson