I can't say for sure, but it looks like you are passing the compiler a bad CFLAG - are you setting up the environment? This is a sample of how I setup my env before compiling anything:
I haven't tried it yet, but it seems that running gcc from within sgugshell will solve the problem.
I didn't use any flags, but they are probably set in default IRIX env.