[Bug target/30282] Optimization flag -O1 -fschedule-insns2 cause red zone to be used when there is none

rearnsha at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Feb 6 13:03:00 GMT 2010



------- 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



More information about the Gcc-bugs mailing list