Canada's benchmark stock index ended up on Wednesday after a slow start as an oil price rebound helped some energy stocks, and gold and base metal miners rose as political uncertainty boosted bullion and a likely squeeze on supply pushed copper prices higher.

The materials group, which includes miners and fertilizer companies, added 0.9 per cent.

Barrick Gold Corp advanced 1.2 per cent to $25.75 and Goldcorp Inc rose 1.1 per cent to $22.27 as bullion hit a three-month peak.

First Quantum Minerals Ltd ended 2.3 per cent higher at $16.29 and Lundin Mining Corp jumped 4.4 per cent to $8.27 as copper prices rose after the world's top two mines said strikes and permit delays would force them to cut output, squeezing global supply.

The Toronto Stock Exchange's S&P/TSX composite index settled up 55.24 points, or 0.36 per cent, at 15,554.04. Eight of the index's 10 groups ended higher, with advancers outnumbering declining issues by a 2.3-to-1 ratio.

The energy group ended 0.2 per cent higher after a sharp retreat earlier in the session.

"We had an initial selloff on the complex and we managed to reverse that with some oversold characteristics," said Sid Mokhtari, a market technician and director of institutional equity research at CIBC World Markets.

"If we give it some time, we should be able to get some better price action out of the oil patch in Canada."

Oil prices rose slightly as investors covered short positions after a rise in U.S. crude inventories was not as massive as many had feared, while gasoline futures jumped four per cent after a surprise decline in inventories of the fuel.

Canada's largest oil and gas producer, Suncor Energy Inc fell 0.3 per cent to $40.51, while pipeline operator Enbridge Inc advanced 1.2 per cent to $56.31.

Bombardier Inc gained two per cent to $2.60 after Canada said it would provide the plane and train maker with $372.5 million in repayable loans for two of its jet programs, causing Brazil to open a formal trade complaint.

Shares in Intact Financial Corp, the country's largest property and casualty insurer, fell 1.5 per cent to $93.88 after the company missed quarterly operating profit expectations on weakness in its auto insurance business.

BlackBerry Ltd shares rose 1.4 per cent to $9.54. The company said on Tuesday it would make its BBM secure-messaging system available for software developers to build into their own products. 

The S&P 500 ended slightly higher on Wednesday as investors digested mixed earnings reports, while the Dow Jones Industrial Average slipped as bank stocks weighed.

The Nasdaq gained moderately to close at a record high for a second straight day, lifted by big tech names such as Facebook and Apple.

Allergan shares rose 3.7 per cent after the drugmaker's fourth-quarter profit and revenue topped estimates. Gilead Sciences shares tumbled 8.6 per cent and were the biggest drag on the benchmark S&P after the biotech company's weak forecast for its hepatitis C medicines.

Major U.S. stock indexes are hovering around record highs after a rally following the Nov. 8 election of President Donald Trump amid expectations he will usher in fiscal stimulus and lower regulations and taxes.

But the rally has stagnated in recent days as investors await more details about Trump's potential economic policy agenda.

"Usually, this would be a period in which earnings and guidance drive the market," said Peter Tuz, president of Chase Investment Counsel in Charlottesville, Virginia.

"But because it's the first three weeks or four weeks of a new president who is promoting radical change than what has been going on, Washington takes precedence, I think, over earnings in the eyes of investors these days."

The Dow Jones Industrial Average fell 35.95 points, or 0.18 per cent, to 20,054.34, the S&P 500 gained 1.59 points, or 0.07 per cent, to 2,294.67 and the Nasdaq Composite added 8.24 points, or 0.15 per cent, to 5,682.45.

Financials, which have soared since the election, were the worst-performing S&P sector, falling 0.8 per cent. Goldman Sachs fell 0.8 per cent, making it the biggest drag on the Dow, and JP Morgan dropped 0.9 per cent.

Bank stocks are sensitive to interest rate changes, and U.S. Treasury yields fell to their lowest levels in weeks.

The real estate and utilities sectors, which tend to perform well in low-rate environments, were the best performing groups.

"As the yield curve flattens, we're back to a very tough environment for financials," said Paul Nolte, portfolio manager at Kingsview Asset Management in Chicago. "They live off the spread."

With about two-thirds of the S&P 500 having reported results, fourth-quarter earnings are on track to have climbed 8.3 per cent, which would be the best performance since the third quarter of 2014, according to Thomson Reuters I/B/E/S.
 In other corporate news, Nordstrom shares rose 4.1 per cent. Trump attacked the retailer on Twitter for dropping his daughter Ivanka's clothing line.

About 6.7 billion shares changed hands on U.S. exchanges, similar to the daily average over the last 20 sessions.

Advancing issues outnumbered declining ones on the NYSE by a 1.29-to-1 ratio; on Nasdaq, a 1.23-to-1 ratio favored decliners.

The S&P 500 posted 19 new 52-week highs and 3 new lows; the Nasdaq Composite recorded 92 new highs and 51 new lows.