* TSX rises 50.21 points, or 0.41 percent, to 12,187.39 * Eight of 10 main sectors advance * CP Rail up 5 percent after job cuts * Primaris Retail gains 14 percent after buyout offer By John Tilak TORONTO, Dec 5 (Reuters) - Canada's main stock index rose on Wednesday, led by energy stocks on optimism about Chinese economic growth and by a rally in Canadian Pacific Railway Ltd on its plan to cut jobs in a bid to lower costs and increase efficiency. Chinese Communist Party chief Xi Jinping said China will maintain its fine-tuning of economic policies in 2013 to ensure stable economic growth. Policies in China, one of the world's biggest commodities consumers, can have an impact on the resource-heavy Canadian market. Energy shares rose 1.1 percent. Suncor Energy Inc was up 1.6 percent at C$32.78, and Canadian Natural Resources Ltd advanced 1.6 percent to C$27.86. "There are expectations of better global growth, driven by ongoing U.S. budget talks and speculation that the Chinese economy is turning around for the better," said Elvis Picardo, strategist and vice president of research at Global Securities in Vancouver. "There is also some degree of takeover speculation. Many Canadian energy producers are trading at pretty attractive valuations. The M&A activity in the U.S. certainly points to the attractiveness of energy assets in North America," Picardo said. U.S. miner Freeport-McMoRan Copper & Gold Inc said on Wednesday it has struck a deal to buy Plains Exploration & Production Co and McMoRan Exploration Co for a total of $9 billion to diversify into the energy sector. At midafternoon, the Toronto Stock Exchange's S&P/TSX composite index was up 50.21 points, or 0.41 percent, at 12,187.39. Eight of its 10 main sectors were trading higher. Canadian Pacific Railway gained 5.2 percent to C$97.85 after the country's second-biggest railroad said it plans to cut 4,500 jobs by 2016 as part of a drive by its new CEO to slash costs. The company played one of the biggest roles in leading the market higher. "This is what shareholders have been looking for. This is what they have been hoping - that CP will face the challenges that they have. The new CEO is making his mark," said Fred Ketchen, director of equity trading at ScotiaMcLeod. Financials, the index's biggest sector, gained 0.6 percent, led by Royal Bank of Canada. Royal, Canada's biggest bank, was up 1.3 percent at C$59.18 and played the biggest role of any single stock in leading the market higher. "The Canadian banks have been firing on all cylinders this year. (They) may also be benefiting today from improved sentiment for banks in general, helped by Citigroup's gains on cost-cutting and Bank of America's advance past $10 for the first time since July 2011," Picardo said. Also boosting the market was Primaris Retail REIT , whose shares rose 14.1 percent to C$26.28 after a consortium led by Canada's KingSett Capital offered about C$2.6 billion ($2.62 billion) to acquire the Canadian shopping mall owner. The index's rise was limited by falling gold mining stocks, hurt by a drop in gold prices to one-month lows. Goldcorp Inc shed 2.1 percent to C$37.05, Barrick Gold Corp fell 1.9 percent to C$33.31, and Eldorado Gold was down 3.2 percent at C$13. 44. As a result, the index's materials sector, which includes mining stocks, lost 0.7 percent. Vincent Delisle, an investment strategist at Scotiabank, said the Toronto market was likely to struggle for the remainder of 2012. "I don't see a year-end bounce, if anything there is a year-end fall, a slight decline. I'm not looking for a Santa Claus rally," he said. The Scotiabank strategist said he sees the benchmark S&P/TSX index rising to 12,800 next year and recommended investors be overweight in the energy, materials and industrials sectors, and underweight in consumer discretionary, financial, telecom and utility stocks.