Fix ia64-linux compiler abort on perl.
authorJim Wilson <wilson@cygnus.com>
Fri, 8 Sep 2000 01:35:53 +0000 (01:35 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Fri, 8 Sep 2000 01:35:53 +0000 (18:35 -0700)
* reload.c (push_reload): Use CLASS_CANNOT_CHANGE_MODE_P in addition
to CLASS_CANNOT_CHANGE_MODE.
* config/ia64/ia64.h (CLASS_CANNOT_CHANGE_MODE_P): True only if the
mode classes are different.

From-SVN: r36256

gcc/ChangeLog
gcc/config/ia64/ia64.h
gcc/reload.c

index 1e0953ddd4480e1a873938dcdd8d84fc80e4861e..6965aea5adefd825f4e999a4844e3a4dbb1935ee 100644 (file)
@@ -1,3 +1,10 @@
+2000-09-07  Jim Wilson  <wilson@cygnus.com>
+
+       * reload.c (push_reload): Use CLASS_CANNOT_CHANGE_MODE_P in addition
+       to CLASS_CANNOT_CHANGE_MODE.
+       * config/ia64/ia64.h (CLASS_CANNOT_CHANGE_MODE_P): True only if the
+       mode classes are different.
+
 2000-09-07  Zack Weinberg  <zack@wolery.cumb.org>
 
        * cpplib.h (struct cpp_options): Add user_label_prefix member,
index 70647450e83152b675d16de3bb202a092a3ebae9..86463b4e02964bd715fe1fc7fc89eba50fc67317 100644 (file)
@@ -1055,9 +1055,12 @@ enum reg_class
 
 #define CLASS_CANNOT_CHANGE_MODE        FR_REGS
 
-/* Defines illegal mode changes for CLASS_CANNOT_CHANGE_MODE.  */
+/* Defines illegal mode changes for CLASS_CANNOT_CHANGE_MODE.
+   In FP regs, we can't change FP values to integer values and vice
+   versa, but we can change e.g. DImode to SImode.  */
 
-#define CLASS_CANNOT_CHANGE_MODE_P(FROM,TO) 1
+#define CLASS_CANNOT_CHANGE_MODE_P(FROM,TO) \
+  (GET_MODE_CLASS (FROM) != GET_MODE_CLASS (TO))
 
 /* A C expression that defines the machine-dependent operand constraint
    letters (`I', `J', `K', .. 'P') that specify particular ranges of
index d83b1f69e3122f4b53379fbb7d761921bf9cea68..d8abd39bef88d3c383f658a873a60f76a1674e23 100644 (file)
@@ -946,7 +946,8 @@ push_reload (in, out, inloc, outloc, class,
   if (in != 0 && GET_CODE (in) == SUBREG
       && (SUBREG_WORD (in) == 0 || strict_low)
 #ifdef CLASS_CANNOT_CHANGE_MODE
-      && class != CLASS_CANNOT_CHANGE_MODE
+      && (class != CLASS_CANNOT_CHANGE_MODE
+         || ! CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (SUBREG_REG (in)), inmode))
 #endif
       && (CONSTANT_P (SUBREG_REG (in))
          || GET_CODE (SUBREG_REG (in)) == PLUS
@@ -1051,7 +1052,9 @@ push_reload (in, out, inloc, outloc, class,
   if (out != 0 && GET_CODE (out) == SUBREG
       && (SUBREG_WORD (out) == 0 || strict_low)
 #ifdef CLASS_CANNOT_CHANGE_MODE
-      && class != CLASS_CANNOT_CHANGE_MODE
+      && (class != CLASS_CANNOT_CHANGE_MODE
+         || ! CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (SUBREG_REG (out)),
+                                          outmode))
 #endif
       && (CONSTANT_P (SUBREG_REG (out))
          || strict_low