From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3084 invoked by alias); 11 Dec 2008 23:05:10 -0000 Received: (qmail 32457 invoked by uid 48); 11 Dec 2008 23:03:47 -0000 Date: Thu, 11 Dec 2008 23:05:00 -0000 Message-ID: <20081211230347.32456.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug rtl-optimization/38245] [4.4 Regression] stack corruption when a call is removed but not the outgoing argument pushes In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ebotcazou at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-12/txt/msg01259.txt.bz2 ------- Comment #11 from ebotcazou at gcc dot gnu dot org 2008-12-11 23:03 ------- > 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. This seems reasonable to me. Because of more urgent issues suddenly popping up in a row, I haven't had time to seriously work on this and probably won't have before next year. Sorry. -- ebotcazou at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|ebotcazou at gcc dot gnu dot|unassigned at gcc dot gnu |org |dot org Status|ASSIGNED |NEW http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38245