The Canadian stock market ended on an upbeat note on Wednesday, extending gains for a second straight day, thanks to better than expected GDP data and gains in global markets.