From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6040 invoked by alias); 28 Nov 2008 14:14:04 -0000 Received: (qmail 5756 invoked by uid 48); 28 Nov 2008 14:12:44 -0000 Date: Fri, 28 Nov 2008 14:14:00 -0000 Message-ID: <20081128141244.5755.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: "jakub 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-11/txt/msg02449.txt.bz2 ------- Comment #4 from jakub at gcc dot gnu dot org 2008-11-28 14:12 ------- *.optimized dump is: D.1611 = (int) (long long unsigned int) g % 2123; if (D.1611 != 0) goto ; else goto ; : if ((signed char) (0 / D.1611) == 1) goto ; else goto ; : vol.2 ={v} h; : return; The problem is that fold_comparison doesn't fold EQ_EXPR (signed char) (0 / D.1611) with 1 (signed char type) into 0 / D.1611, false, nor anything else optimizes this at the tree level. I guess e.g. VRP should be able to find this out. Even when that is fixed (can look at it), I guess there still be possibilities that tree optimizers miss something that the RTL optimizers might DCE away (otherwise, why would we run RTL DCE at all?). The call BTW doesn't pop any arguments on return. I guess option 3 is remove this i386.c optimization, assume only very few calls will be DCEd at RTL level and count with the fact that their argument stores might not have been eliminated. For x86_64 this wouldn't make a difference for calls that pass args only in registers - the outgoing args size will be 0 in that case anyway. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38245