Commited on behalf of geoffk@cygnus.com:
authorGeoff Keating <geoffk@cygnus.com>
Sat, 8 Jul 2000 12:42:09 +0000 (12:42 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sat, 8 Jul 2000 12:42:09 +0000 (12:42 +0000)
* config/rs6000/rs6000.c (rs6000_emit_move): Fix conditions for
emitting aux_truncdfsf2.

From-SVN: r34925

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index 5048c23..6b34b7a 100644 (file)
@@ -1,3 +1,8 @@
+2000-07-08  Geoffrey Keating  <geoffk@cygnus.com>
+
+       * config/rs6000/rs6000.c (rs6000_emit_move): Fix conditions for
+       emitting aux_truncdfsf2.
+
 2000-07-03  Donn Terry  (donnte@microsoft.com)
 
        * cppinit.c (print_help): split overlong line into ISO C89
index 73b46df..ba8562b 100644 (file)
@@ -1492,10 +1492,17 @@ rs6000_emit_move (dest, source, mode)
   if (! no_new_pseudos && GET_CODE (operands[0]) != REG)
     operands[1] = force_reg (mode, operands[1]);
   
-  if (mode == SFmode && ! TARGET_POWERPC && TARGET_HARD_FLOAT)
+  if (mode == SFmode && ! TARGET_POWERPC && TARGET_HARD_FLOAT
+      && GET_CODE (operands[0]) == MEM)
     {
-      int regnum = true_regnum (operands[1]);
-      /* regnum may be -1 in which case the test below will fail.  */  
+      int regnum;
+
+      if (reload_in_progress || reload_completed)
+       regnum = true_regnum (operands[1]);
+      else if (GET_CODE (operands[1]) == REG)
+       regnum = REGNO (operands[1]);
+      else
+       regnum = -1;
       
       /* If operands[1] is a register, on POWER it may have
         double-precision data in it, so truncate it to single