This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/38245] [4.4 Regression] stack corruption when a call is removed but not the outgoing argument pushes
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Dec 2008 11:07:36 -0000
- Subject: [Bug rtl-optimization/38245] [4.4 Regression] stack corruption when a call is removed but not the outgoing argument pushes
- References: <bug-38245-12544@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from jakub at gcc dot gnu dot org 2008-12-05 11:07 -------
I guess for !ACCUMULATE_OUTGOING_ARGS DCE of calls having stack arguments
generally shouldn't be an issue (unless they pop the stack themselves, don't
remember if it is easily determinable in generic way), worst case where will be
some pushes and some pops or stack additions left around.
For ACCUMULATE_OUTGOING_ARGS you could use:
(expr_list:REG_DEP_TRUE (use (mem:SI (reg/f:SI 7 sp) [0 S4 A8]))
(expr_list:REG_DEP_TRUE (use (mem:SI (plus:SI (reg/f:SI 7 sp)
(const_int 4 [0x4])) [0 S4 A8]))
(nil))))
from the CALL_INSN, just see if you can find safely and remove also the stores
to those stack locations, if yes, remove them together with the call, if not,
don't DCE the call either.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38245