This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: PR target/31344: Bootstrap is broken on i[345]86-linux


On Sun, Apr 29, 2007 at 05:14:05PM -0700, H. J. Lu wrote:
> 
> emit_single_push_insn calls emit_move_insn to push dfp. emit_move_insn
> calls emit_move_via_integer to push dfp via integer, which generates
> 
> (set (reg/f:SI 67) (pre_dec:SI (reg/f:SI 7 sp)))
> 
> It leads to an unrecognizable insn error. I am not sure if
> emit_move_via_integer properly handles moving from Y to X and X
> satifies push_operand.
> 
> 

Does this patch makes any senses?


H.J.
----
2007-04-29  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/31344
	* expr.c (emit_move_resolve_push): Move it before ...
	(emit_move_via_integer): This.  Call emit_move_resolve_push to
	replace the push destination with a reference to the stack
	pointer.

--- gcc/expr.c.push	2007-04-29 08:19:58.000000000 -0700
+++ gcc/expr.c	2007-04-29 17:19:49.000000000 -0700
@@ -2898,35 +2898,6 @@ emit_move_change_mode (enum machine_mode
   return ret;
 }
 
-/* A subroutine of emit_move_insn_1.  Generate a move from Y into X using
-   an integer mode of the same size as MODE.  Returns the instruction
-   emitted, or NULL if such a move could not be generated.  */
-
-static rtx
-emit_move_via_integer (enum machine_mode mode, rtx x, rtx y, bool force)
-{
-  enum machine_mode imode;
-  enum insn_code code;
-
-  /* There must exist a mode of the exact size we require.  */
-  imode = int_mode_for_mode (mode);
-  if (imode == BLKmode)
-    return NULL_RTX;
-
-  /* The target must support moves in this mode.  */
-  code = mov_optab->handlers[imode].insn_code;
-  if (code == CODE_FOR_nothing)
-    return NULL_RTX;
-
-  x = emit_move_change_mode (imode, mode, x, force);
-  if (x == NULL_RTX)
-    return NULL_RTX;
-  y = emit_move_change_mode (imode, mode, y, force);
-  if (y == NULL_RTX)
-    return NULL_RTX;
-  return emit_insn (GEN_FCN (code) (x, y));
-}
-
 /* A subroutine of emit_move_insn_1.  X is a push_operand in MODE.
    Return an equivalent MEM that does not use an auto-increment.  */
 
@@ -2984,6 +2955,40 @@ emit_move_resolve_push (enum machine_mod
   return replace_equiv_address (x, temp);
 }
 
+/* A subroutine of emit_move_insn_1.  Generate a move from Y into X using
+   an integer mode of the same size as MODE.  Returns the instruction
+   emitted, or NULL if such a move could not be generated.  */
+
+static rtx
+emit_move_via_integer (enum machine_mode mode, rtx x, rtx y, bool force)
+{
+  enum machine_mode imode;
+  enum insn_code code;
+
+  /* There must exist a mode of the exact size we require.  */
+  imode = int_mode_for_mode (mode);
+  if (imode == BLKmode)
+    return NULL_RTX;
+
+  /* The target must support moves in this mode.  */
+  code = mov_optab->handlers[imode].insn_code;
+  if (code == CODE_FOR_nothing)
+    return NULL_RTX;
+
+  /* If X is a push on the stack, do the push now and replace
+     X with a reference to the stack pointer.  */
+  if (push_operand (x, mode))
+    x = emit_move_resolve_push (mode, x);
+
+  x = emit_move_change_mode (imode, mode, x, force);
+  if (x == NULL_RTX)
+    return NULL_RTX;
+  y = emit_move_change_mode (imode, mode, y, force);
+  if (y == NULL_RTX)
+    return NULL_RTX;
+  return emit_insn (GEN_FCN (code) (x, y));
+}
+
 /* A subroutine of emit_move_complex.  Generate a move from Y into X.
    X is known to satisfy push_operand, and MODE is known to be complex.
    Returns the last instruction emitted.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]