Compiling gcc yourself is definitely an option. It is not too hard; I managed to compile gcc 4.8.1 on RHEL 5.9 following the link Ярослав Рахматуллин mentioned. I had to download mpfr (3.1.2, http://www.mpfr.org/), gmp (5.1.2, http://gmplib.org/) and mpc (1.0.1, http://www.multiprecision.org/) as dependencies.
Especially useful tips derived from the Manual Compilation document:
* unpack the mpfr, gmp and mpc sources into your gcc source directory and link them like this: ln -s mpfr-3.1.2 mpfr ; ln -s gmp-5.1.2 gmp ; ln -s mpc-1.0.1 mpc.
* use out-of-source building (e.g. on the same level as your gcc-4.8.1 source dir resides: mkdir gcc-build ; cd gcc-build ; ../gcc-4.8.1/configure --prefix=/home/user/usr)
The actual compilation of the whole compiler collection took ages even though I used 10 processors for parallel building.
As suggested by Ярослав Рахматуллин, in case your installation directory (prefix) already contains other compiled programs, you might want to "record" the contents of it before and after doing 'make install' doing something like this:
'find /home/user/usr > state.before ; make install ; find /home/user/usr > state.after'
so you could compare the two files and delete the differences, should it ever be necessary to remove the new gcc (I must note though, that I personally have not tried this method, but rather keep the build directory to be able to do 'make uninstall').
Be sure to adjust your PATH variable to include /home/user/usr/bin.