------- Comment #12 from rearnsha at gcc dot gnu dot org 2010-02-06 13:03 ------- Yes, this could be fixed in the Thumb back-end by doing it the same way as the ARM back-end does. However, I still think that is papering over a subtle problem in the scheduler. This is an insidious problem that can affect a number of ports (since it quietly leads to hard-to-detect wrong-code problems) and I feel it's poor design in the compiler to leave it up to each port maintainer to find the problem (bugs like this are often not found by users during testing because it requires an asynchronous event to occur at exactly the right moment to expose them).
I strongly believe the scheduler should have along the lines of the one I've proposed, and if there is a hook, then the default behaviour should be to block scheduling across a stack adjustment. Ports which are known to have a stack red-zone can then disable the effect and gain an advantage -- that has to be better than leaving subtle bugs in user's code. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30282