Installation depends
yum groupinstall "Development Tools"
yum install -y glibc-static libstdc++-static wget
Download Source
Download Source can use different gcc mirror, I am here to download this American relatively stable, if the mirror does not work well, then you can go
http://www.gnu.org/software/gcc/mirrors.html
Trying to find the right image to download
wget http://www.netgull.com/gcc/releases/gcc-5.4.0/gcc-5.4.0.tar.bz2
Compile and install
Here will be relatively slow, consider compiling in the background or screen with nohub
tar -xvf gcc-5.4.0.tar.bz2 && \
cd gcc-5.4.0 && \
./contrib/download_prerequisites && \
mkdir build && \
cd build && \
../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib && \
make && make install