I believe the work around for PR's 1159 and 1412 is to compile with -fno-defer-pop. The loops are messed up because we're missing pending stack adjustments somewhere. I would have added this to the PR notes, but I don't appear to have write access to the gcc bug database :-( AG