From 886cbb88812fc1989ec64efb02f2088852a9408c Mon Sep 17 00:00:00 2001
From: Jan Hubicka <jh@suse.cz>
Date: Fri, 30 Mar 2001 17:43:44 +0200
Subject: [PATCH] i386.c (ix86_split_long_move): Use change address to
 compensate stack pointer change in push instruction.

	* i386.c (ix86_split_long_move): Use change address to compensate
	stack pointer change in push instruction.

From-SVN: r40968
---
 gcc/ChangeLog          | 5 +++++
 gcc/config/i386/i386.c | 8 ++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6696baf7173d..533b520f7634 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Fri Mar 30 17:36:43 CEST 2001  Jan Hubicka  <jh@suse.cz>
+
+	* i386.c (ix86_split_long_move): Use change address to compensate
+	stack pointer change in push instruction.
+
 Fri Mar 30 00:31:00 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
 	* i386.md (sse_movdfcc_eq): Fix constraint (sse_mov?fcc splitter): Use operands_match_p
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 5dc9fa9821f4..9d63c5ed23ca 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -6917,8 +6917,10 @@ ix86_split_long_move (operands)
       && reg_overlap_mentioned_p (stack_pointer_rtx, operands[1]))
     {
       if (nparts == 3)
-	part[1][1] = part[1][2];
-      part[1][0] = part[1][1];
+	part[1][1] = change_address (part[1][1], GET_MODE (part[1][1]),
+				     XEXP (part[1][2], 0));
+      part[1][0] = change_address (part[1][0], GET_MODE (part[1][0]),
+				   XEXP (part[1][1], 0));
     }
 
   /* We need to do copy in the right order in case an address register
@@ -6990,6 +6992,8 @@ ix86_split_long_move (operands)
 		part[1][1] = gen_rtx_REG (DImode, REGNO (part[1][1]));
 	      else
 		abort();
+	      if (GET_MODE (part[1][0]) == SImode)
+		part[1][0] = part[1][1];
 	    }
 	}
       emit_move_insn (part[0][1], part[1][1]);
-- 
GitLab