emit-rtl.c (gen_lowpart_common): Use word 0 if register mode is narrower than request...
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 23 Nov 2000 13:23:04 +0000 (13:23 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 23 Nov 2000 13:23:04 +0000 (13:23 +0000)
* emit-rtl.c (gen_lowpart_common): Use word 0 if register mode
is narrower than requested mode.
(gen_highpart): Abort if register mode is narrower than
requested mode.

From-SVN: r37696

gcc/ChangeLog
gcc/emit-rtl.c

index 6721de104f3872806652216cad130739db973865..8263d94cda5dda2a612f59af9d1da555c1a5971d 100644 (file)
@@ -1,3 +1,10 @@
+2000-11-23  Alexandre Oliva  <aoliva@redhat.com>
+
+       * emit-rtl.c (gen_lowpart_common): Use word 0 if register mode
+       is narrower than requested mode.
+       (gen_highpart): Abort if register mode is narrower than
+       requested mode.
+
 2000-11-23  Graham Stott  <grahams@redhat.com>
 
        * cse.c (cse_insn): Initialise all regcost variables.
index db1c73fc936bf6a0a4374e6211e85478dcd6c604..4329346260a3083b17d807196d876155a15efff7 100644 (file)
@@ -709,7 +709,8 @@ gen_lowpart_common (mode, x)
         regs are sized by the underlying register size.  Better would be
         to always interpret the subreg offset parameter as bytes or bits.  */
 
-      if (WORDS_BIG_ENDIAN && REGNO (x) < FIRST_PSEUDO_REGISTER)
+      if (WORDS_BIG_ENDIAN && REGNO (x) < FIRST_PSEUDO_REGISTER
+         && GET_MODE_SIZE (GET_MODE (x)) > GET_MODE_SIZE (mode))
        word = (HARD_REGNO_NREGS (REGNO (x), GET_MODE (x))
                - HARD_REGNO_NREGS (REGNO (x), mode));
 
@@ -1141,7 +1142,9 @@ gen_highpart (mode, x)
         regs are sized by the underlying register size.  Better would be
         to always interpret the subreg offset parameter as bytes or bits.  */
 
-      if (WORDS_BIG_ENDIAN)
+      if (GET_MODE_SIZE (GET_MODE (x)) < GET_MODE_SIZE (mode))
+       abort ();
+      else if (WORDS_BIG_ENDIAN)
        word = 0;
       else if (REGNO (x) < FIRST_PSEUDO_REGISTER)
        word = (HARD_REGNO_NREGS (REGNO (x), GET_MODE (x))