By Jennifer Kwan

TORONTO (Reuters) - Toronto's main stock index
closed higher Wednesday, swinging back from a five-week low
hit earlier in the day, as gold prices climbed and Canadian
Imperial Bank of Commerce unveiled results that topped
market expectations.

Big names on the upside included gold miners Barrick Gold
, up 3.3 percent at C$47.96, and Goldcorp, which
soared 3.7 percent to C$44.60 as the price of bullion rose.
The index's materials sector, home to fertilizer
companies and miners, rose 2 percent.

Financials gained as CIBC reported a strong third-quarter
profit, relieving some concern about bank results after Bank of
Montreal reported a weaker-than-expected profit on Tuesday.
Shares of CIBC, the top net gainer on the market, climbed 4.9
percent to C$70.08.

"CIBC's results beat expectations and have taken the sting
out of the weaker BMO numbers," said John Johnston, chief
strategist for Harbour Group at RBC Dominion Securities.

"It's kind of feeding a better view on the Canadian
banks."

Royal Bank of Canada was up 1.2 percent at C$50.69,
and Bank of Montreal rose 1.5 percent to C$56.34.
Toronto-Dominion Bank edged 0.3 percent higher to
C$69.63, while Bank of Nova Scotia shot up 1.7 percent
to C$50.44.

The Toronto Stock Exchange's S&P/TSX composite index
ended the day up 90.77 points, or 0.79 percent, at
11,648.12, with seven of its 10 main sectors higher.

The blue chip S&P/TSX 60 index closed 5.73 points,
or 0.85 percent, higher at 678.33.

Earlier in the session it hit its lowest point since July
21 at 11,469.25 on gathering worries over the outlook for the
global economy, underscored by U.S. data.

New U.S. home sales hit a record low in July and orders for
durable goods were weak, heightening fears the U.S. economy was
at risk of a new downturn.

The economic weakness was a key factor driving up the price
of gold as a safe-haven play, said RBC's Johnston.

"There's an element of fear creeping back into the system.
Precious metals have a history of doing well in times of
turmoil," he said.

"The behavior over history has reinforced the message of
the gold bugs that gold is a safe asset to own in times of
upset."

Takeover target Potash Corp of Saskatchewan, a top net
decliner, dropped 2.1 percent to C$154.51 as BHP Billiton
tried to damp expectations it would sweeten its
hostile $39-billion $130-a-share offer for the world's largest
potash producer.

The stock had been pushed up in recent sessions on market
speculation it would attract a higher takeover bid from BHP
Billiton, or possibly another player.

"The longer nothing comes out of another suitor the more
cautious the market is going to be," said Anil Tahiliani,
portfolio manager at McLean & Partners Wealth Management Ltd in
Calgary.

($1=$1.06 Canadian)
(Reporting by Jennifer Kwan; editing by Peter Galloway)