Ok... a ton of experimenting with this problem and the OP's code...
I can replicate the error in 6.0 if I select Minimize Size or Minimize Size More in the project options dialog (I normally Maximize Speed)... it appears that it is connected to the -OS flag... When that flag is not present I don't get the problem... when it is, I do. I tried different calling conventions, fast and precise floating point modes, all inlining options and it appears to happen only when the -Os flag is present.
Can anyone else repilcate this to be sure?
It's clearly a bug... I hope this is enough to help Pelle fix it.
See the attached screenshot... I've highlighted the "bad actors"....