How to install an older version of gcc on Fedora
Build gcc-8.2.0
# dnf install gcc-c++ flex bison binutils-devel elfutils-devel elfutils-libelf-devel
tar xvf gcc-8.2.0.tar.xz
cd gcc-8.2.0/
tar xvf mpfr-4.0.2.tar.xz && mv -v mpfr-4.0.2 mpfr
tar xvf gmp-6.1.2.tar.xz && mv -v gmp-6.1.2 gmp
tar xvf mpc-1.1.0.tar.gz && mv -v mpc-1.1.0 mpc
cd ../
mkdir build-gcc820
cd build-gcc820/
../gcc-8.2.0/configure --prefix=/usr/local/gcc82 --program-suffix=82 --enable-languages=c,c++,fortran --disable-multilib --disable-libstdcxx-pch
make
# make install
Result : gcc82-c++-8.2.0-2.fc29.x86_64.rpm
https://drive.google.com/file/d/1qGPvF9jc6CiI1a0-c3I4Zj4vxajEwSzc/view?usp=sharing
Provides /usr/bin/{gcc8, g++8, gfortran8}
Install : # dnf install Downloads/gcc82-c++-8.2.0-2.fc29.x86_64.rpm