GCC 6.3 is available in Jonathon F's Launchpad repository:
https://launchpad.net/~jonathonf/+archive/ubuntu/gcc-6.3
This PPA could be used for installing GCC 6.3 from package, rather than from source, which should usually be the last resort (do note, it is not an official Ubuntu PPA).
For installing GCC 6.3 on Ubuntu 16.04, follow this procedure:
Remove any previous gcc-6 version installed:
sudo apt-get remove --purge gcc-6 g++-6 gcc-6-multilib
sudo apt autoremove
Add the gcc-6.3 PPA:
sudo add-apt-repository ppa:jonathonf/gcc-6.3
sudo apt-get update
Install the specific gcc-6.3 version, 6.3.0-21ubuntu1~16.04.york0
in our case:
VER=6.3.0-21ubuntu1~16.04.york0 && sudo apt-get install gcc-6-base=$VER gcc-6=$VER g++-6=$VER cpp-6=$VER libgcc-6-dev=$VER libstdc++-6-dev=$VER libasan3=$VER
Check the version of the just installed gcc with gcc-6 -v
. Expected:
gcc version 6.3.0 20170628 (Ubuntu 6.3.0-21ubuntu1~16.04.york0)