A sign board displaying Toronto Stock Exchange (TSX) stock information is seen in Toronto June 23, 2014.
A sign board displaying Toronto Stock Exchange (TSX) stock information is seen in Toronto June 23, 2014. Reuters / Mark Blinch

Canada's main stock index rose on Thursday to its highest level in more than six weeks as investors cheered corporate earnings results, shrugging off data that showed the U.S. economy contracting for a second straight quarter.

The Toronto Stock Exchange's S&P/TSX composite index ended up 202.15 points, or 1.1%, at 19,456.71, its highest closing level since June 15.

Wall Street also rallied as the decline in GDP data raised speculation that the Federal Reserve may not need to be as aggressive with interest rate hikes as some had thought.

Fed tightening has rattled global equity markets in 2022. The TSX is down 8.3% since the start of the year.

"No question overall you are going to have slower growth but you got to maintain positivity in the fact that the numbers from some of these companies, the earnings, are not recessionary numbers and the guidance is not recessionary guidance," said Barry Schwartz, a portfolio manager at Baskin Financial Services.

"People maybe are now positioning their portfolios for a rebound instead of more pain."

The energy sector advanced 2.2%, helped by a 13.8% jump in the shares of Ballard Power Systems Inc, tracking gains for U.S. clean energy stocks after Democratic Senator Joe Manchin, a key swing vote, supported a proposal for new climate change spending.

The materials group, which includes precious and base metals miners and fertilizer companies, added 1.6%, as gold and copper prices rallied.

Agnico Eagle Mines Ltd rose 6.4% after reporting better-than-expected quarterly earnings, while cannabis producer Tilray Brands Inc was up 13.8% on a jump in revenue.

Weighing on the index, Bausch Health shares tumbled 50.6% as a Delaware federal district court judge said parts of patents related to BHC subsidiary Salix Pharmaceuticals' drug, Xifaxan, are not valid.