Hi,
Hard to say where things are going awry.
My recommendation is to compile with the -g flag (and your normal optimization flags, like -O2 or whatever), and when the C code fails take a look at the core dump's bt (backtrace) in the debugger.
Or attach the debugger to the live, running program.
Or to run the program within the debugger (if possible).
I found three compiler related optimization bugs for GCC 2.95 on an Ultra 5, running on SunOS 5.8. So it's not inconceivable that there may be a USIV related bug with GCC 3.4.2. Maybe. (I'm not ruling out programmer error, either.)
HTH, --Eljay