Michael,
I have had things like this happen in the past. It was always something wrong with what I wrote in the code relative to the ANSI-C spec. I doubt it is anything wrong with the compiler. You should inspect the generated assembly code and figure out what the code is doing. That will tell you what is wrong.
It is sometimes useful to boil the code down to a very simply test case as well.
Regards,
David