The source code for Apple's versions of GCC is available using anonymous CVS, from :pserver:anonymous@anoncvs.opensource.apple.com:/cvs/root with password anonymous, as module gcc3.
For example, you can fetch the latest version by entering:
$ cvs -d :pserver:anonymous@anoncvs.opensource.apple.com:/cvs/root login Password: anonymous $ cvs -d :pserver:anonymous@anoncvs.opensource.apple.com:/cvs/root -z6 \ co gcc3
Each version will be tagged based on its build number, which you can find by executing gcc --version; for instance, if this prints
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1402)
then the build number is 1402. Some older compilers may require you use gcc -v to obtain the build number. Most versions are tagged like gcc-1402; you can find a list of suitable tags with a command like cvs log gcc3/gcc/version.c. Once you have the tag, you can use the -r flag to CVS, for instance
$ cvs -d :pserver:anonymous@anoncvs.opensource.apple.com:/cvs/root -z6 \ co -r gcc-1402 gcc3