This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/38644] [4.4/4.5/4.6/4.7 Regression] Optimization flag -O1 -fschedule-insns2 causes wrong code
- From: "rearnsha at arm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 12 Sep 2011 15:31:51 +0000
- Subject: [Bug rtl-optimization/38644] [4.4/4.5/4.6/4.7 Regression] Optimization flag -O1 -fschedule-insns2 causes wrong code
- Auto-submitted: auto-generated
- References: <bug-38644-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38644
--- Comment #48 from Richard Earnshaw <rearnsha at arm dot com> 2011-09-12 15:31:51 UTC ---
On 12/09/11 16:18, law at redhat dot com wrote:
> A much simpler way to fix this is to emit a barrier just prior to
> mucking around with stack pointer in the epilogue. That's how targets
> have dealt with this exact issue for a couple decades.
Simpler, but wrong. The compiler should not be generating unsafe code
by default. The problem is in the mid-end and expecting every port to
get this right in order to work-around a mid-end bug is just stupid
stupid stupid.
The mid end should not be scheduling around stack moves unless it has
been explicitly told it is safe to do this. I don't understand why
there is so much resistance to fixing the problem properly.