OSDN Git Service

PR ada/24533
[pf3gnuchains/gcc-fork.git] / gcc / rtlhooks.c
index 9d5dafd..0034da7 100644 (file)
@@ -15,8 +15,8 @@ for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 #include "config.h"
 #include "system.h"
@@ -44,9 +44,12 @@ gen_lowpart_general (enum machine_mode mode, rtx x)
 
   if (result)
     return result;
-  else if (REG_P (x))
+  /* 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)))))
     {
-      /* Must be a hard reg that's not valid in MODE.  */
       result = gen_lowpart_common (mode, copy_to_reg (x));
       gcc_assert (result != 0);
       return result;