From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7038 invoked by alias); 11 Dec 2013 08:34:08 -0000 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 Received: (qmail 7006 invoked by uid 48); 11 Dec 2013 08:34:01 -0000 From: "ktietz at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/56807] mingw32: Conflict between stack realignment and stack probe destroys function argument in EAX Date: Wed, 11 Dec 2013 08:34:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.7.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ktietz at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-12/txt/msg00935.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56807 --- Comment #14 from Kai Tietz --- Sorry for that on the 4.7 branch. plus_constant function takes one argument less on 4.7 branch. Following patch fixes the issue for me: Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (Revision 205882) +++ config/i386/i386.c (Arbeitskopie) @@ -10431,15 +10431,15 @@ ix86_expand_prologue (void) if (r10_live && eax_live) { - t = plus_constant (Pmode, stack_pointer_rtx, allocate); + t = plus_constant (stack_pointer_rtx, allocate); emit_move_insn (r10, gen_frame_mem (Pmode, t)); - t = plus_constant (Pmode, stack_pointer_rtx, + t = plus_constant (stack_pointer_rtx, allocate - UNITS_PER_WORD); emit_move_insn (eax, gen_frame_mem (Pmode, t)); } else if (eax_live || r10_live) { - t = plus_constant (Pmode, stack_pointer_rtx, allocate); + t = plus_constant (stack_pointer_rtx, allocate); emit_move_insn ((eax_live ? eax : r10), gen_frame_mem (Pmode, t)); } }