The 'gcc compiler' is installed when one installs 'XcodeTools' (via the 'XcodeTools.mpkg' file) from the installation CD (if installing Panther [MacOS X 10.3.x] or earlier) / DVD - in the '/Xcode Tools/' folder.
Or, in the CDs' / DVDs' '/Xcode Tools/Packages/' folder is / are the 'gccx.x.pkg' (where s.x is the version number) installer file(s).