The idea is more get GCC working even if not the latest, because believe me it is not that obvious to compile from scratch with all the dependencies...
Even with HP depot you will have to solve the...
At the porting and Archive center you have a GCC package...
I suggest you get that one working first:
Go to:
HP-UX Porting and Archiving Centre | zlib-1.2.8...