I had a C compiler on my personal computer and the same program ran and compiled fine there, but we had to submit our solution in source code form on the Department's shared system to plug into the class' automated build and test scripts.
Eventually, I discovered that adding an extra space to a comment fixed the error. I wasn't experienced enough to at the time to know how to use GDB to disassemble and debug binaries, but, looking back, I think I must have triggered a compiler bug that misaligned an instruction (Sparcs were 4-byte aligned, IIRC) and adding the extra space somehow fixed the alignment of the generated code.