OSDN Git Service

./:
[pf3gnuchains/gcc-fork.git] / gcc / rtlhooks.c
index 8939b21..4cf757d 100644 (file)
@@ -1,5 +1,5 @@
 /* Generic hooks for the RTL middle-end.
-   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -43,11 +43,9 @@ gen_lowpart_general (enum machine_mode mode, rtx x)
 
   if (result)
     return result;
-  /* If it's a REG, it must be a hard reg that's not valid in MODE.  */
-  else if (REG_P (x)
-          /* Or we could have a subreg of a floating point value.  */
-          || (GET_CODE (x) == SUBREG
-              && FLOAT_MODE_P (GET_MODE (SUBREG_REG (x)))))
+  /* Handle SUBREGs and hard REGs that were rejected by
+     simplify_gen_subreg.  */
+  else if (REG_P (x) || GET_CODE (x) == SUBREG)
     {
       result = gen_lowpart_common (mode, copy_to_reg (x));
       gcc_assert (result != 0);
@@ -143,7 +141,7 @@ gen_lowpart_if_possible (enum machine_mode mode, rtx x)
     {
       /* This is the only other case we handle.  */
       int offset = 0;
-      rtx new;
+      rtx new_rtx;
 
       if (WORDS_BIG_ENDIAN)
        offset = (MAX (GET_MODE_SIZE (GET_MODE (x)), UNITS_PER_WORD)
@@ -154,11 +152,11 @@ gen_lowpart_if_possible (enum machine_mode mode, rtx x)
        offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode))
                   - MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x))));
 
-      new = adjust_address_nv (x, mode, offset);
-      if (! memory_address_p (mode, XEXP (new, 0)))
+      new_rtx = adjust_address_nv (x, mode, offset);
+      if (! memory_address_p (mode, XEXP (new_rtx, 0)))
        return 0;
 
-      return new;
+      return new_rtx;
     }
   else if (mode != GET_MODE (x) && GET_MODE (x) != VOIDmode
           && validate_subreg (mode, GET_MODE (x), x,