OSDN Git Service

* expr.c (emit_move_change_mode): Always adjust addresses, not
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jan 2006 23:43:27 +0000 (23:43 +0000)
committerbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jan 2006 23:43:27 +0000 (23:43 +0000)
just during reload.  Copy replacements only during reload.
(emit_move_insn_1): Move MODE_DECIMAL_FLOAT modes by invoking
emit_move_via_integer.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109845 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expr.c

index 8b769bc..2ac7d8b 100644 (file)
@@ -1,3 +1,10 @@
+2006-01-18  Ben Elliston  <bje@au.ibm.com>     
+
+       * expr.c (emit_move_change_mode): Always adjust addresses, not
+       just during reload.  Copy replacements only during reload.
+       (emit_move_insn_1): Move MODE_DECIMAL_FLOAT modes by invoking
+       emit_move_via_integer.
+
 2006-01-17  Shantonu Sen  <ssen@opendarwin.org>
 
        * Makefile.in (check-%, check-consistency): Use $${srcdir}
index 7a83b7e..92048ff 100644 (file)
@@ -1,6 +1,7 @@
 /* Convert tree expression to rtl instructions, for GNU compiler.
    Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+   Inc.
 
 This file is part of GCC.
 
@@ -2783,17 +2784,19 @@ emit_move_change_mode (enum machine_mode new_mode,
 {
   rtx ret;
 
-  if (reload_in_progress && MEM_P (x))
+  if (MEM_P (x))
     {
-      /* We can't use gen_lowpart here because it may call change_address
-        which is not appropriate if we were called when a reload was in
-        progress.  We don't have to worry about changing the address since
-        the size in bytes is supposed to be the same.  Copy the MEM to
-        change the mode and move any substitutions from the old MEM to
-        the new one.  */
-
-      ret = adjust_address_nv (x, new_mode, 0);
-      copy_replacements (x, ret);
+      /* We don't have to worry about changing the address since the
+        size in bytes is supposed to be the same.  */
+      if (reload_in_progress)
+       {
+         /* Copy the MEM to change the mode and move any
+            substitutions from the old MEM to the new one.  */
+         ret = adjust_address_nv (x, new_mode, 0);
+         copy_replacements (x, ret);
+       }
+      else
+       ret = adjust_address (x, new_mode, 0);
     }
   else
     {
@@ -3128,6 +3131,17 @@ emit_move_insn_1 (rtx x, rtx y)
   if (COMPLEX_MODE_P (mode))
     return emit_move_complex (mode, x, y);
 
+  if (GET_MODE_CLASS (mode) == MODE_DECIMAL_FLOAT)
+    {
+      rtx result = emit_move_via_integer (mode, x, y, true);
+
+      /* If we can't find an integer mode, use multi words.  */
+      if (result)
+       return result;
+      else
+       return emit_move_multi_word (mode, x, y);
+    }
+
   if (GET_MODE_CLASS (mode) == MODE_CC)
     return emit_move_ccmode (mode, x, y);