From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21007 invoked by alias); 16 Oct 2004 20:55:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 20996 invoked from network); 16 Oct 2004 20:55:49 -0000 Received: from unknown (HELO mail.libertysurf.net) (213.36.80.91) by sourceware.org with SMTP; 16 Oct 2004 20:55:49 -0000 Received: from dyn-213-36-36-165.ppp.tiscali.fr (213.36.36.165) by mail.libertysurf.net (6.5.036) id 4170BE3200188E93 for gcc-patches@gcc.gnu.org; Sat, 16 Oct 2004 22:55:48 +0200 From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR middle-end/17813 Date: Sat, 16 Oct 2004 21:22:00 -0000 User-Agent: KMail/1.6.1 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200410162252.58887.ebotcazou@libertysurf.fr> Content-Type: Multipart/Mixed; boundary="Boundary-00=_kqYcBNxXITqDqzP" X-SW-Source: 2004-10/txt/msg01352.txt.bz2 --Boundary-00=_kqYcBNxXITqDqzP Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-length: 650 Hi, This is the Ada compiler bootstrap failure on i586 and below, which again pertains to stack adjustments. cstand.adb:Create_Standard is miscompiled because a stack adjustment is emitted right after a __builtin_stack_restore. The proposed fix is to emit pending stack adjustments right before __builtin_stack_save and __builtin_stack_restore. Bootstrapped on i586-mandrake-linux-gnu (with the workaround for PR tree-opt/17986). OK for mainline? 2004-10-16  Eric Botcazou   PR middle-end/17813 * explow.c (emit_stack_save): Emit pending stack adjustments. (emit_stack_restore): Likewise. -- Eric Botcazou --Boundary-00=_kqYcBNxXITqDqzP Content-Type: text/x-diff; charset="iso-8859-1"; name="pr17813.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr17813.diff" Content-length: 1301 Index: explow.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/explow.c,v retrieving revision 1.139 diff -u -p -r1.139 explow.c --- explow.c 8 Sep 2004 08:05:13 -0000 1.139 +++ explow.c 16 Oct 2004 16:41:55 -0000 @@ -965,6 +965,7 @@ emit_stack_save (enum save_level save_le rtx seq; start_sequence (); + do_pending_stack_adjust (); /* We must validize inside the sequence, to ensure that any instructions created by the validize call also get moved to the right place. */ if (sa != 0) @@ -976,6 +977,7 @@ emit_stack_save (enum save_level save_le } else { + do_pending_stack_adjust (); if (sa != 0) sa = validize_mem (sa); emit_insn (fcn (sa, stack_pointer_rtx)); @@ -1037,13 +1039,17 @@ emit_stack_restore (enum save_level save rtx seq; start_sequence (); + do_pending_stack_adjust (); emit_insn (fcn (stack_pointer_rtx, sa)); seq = get_insns (); end_sequence (); emit_insn_after (seq, after); } else - emit_insn (fcn (stack_pointer_rtx, sa)); + { + do_pending_stack_adjust (); + emit_insn (fcn (stack_pointer_rtx, sa)); + } } /* Invoke emit_stack_save on the nonlocal_goto_save_area for the current --Boundary-00=_kqYcBNxXITqDqzP--