Why would you need a newer version of GCC on Tails in the first place?
You want to be familiar with Debian's package manager, aptitude, because Tails is based on Debian.
Remember that you'll most likely end up doing this every time again because Tails will be back to default the next time you boot (considering that you don't use persistent storage).
If we look at Debian's website we see that they didn't provide a binary yet for Debian 9.3.0. This is because Aptitude's packages are extremely stable and usually a little outdated.
So instead we want to go to the official site, download the GCC tarball that we would like (.tar.gz), unpack the tarball with the command
tar xvf <file>.tar.gz and read the
README.md file (or something similar) with an explanation on how to build this package.
Because this build can take a pretty long amount of time I highly recommend you to do this on a persistent operating system instead of Tails.