* emit_rtl.c (gen_lowpart_common): Conversion from const_int
authorhpenner <hpenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Jan 2002 12:30:37 +0000 (12:30 +0000)
committerhpenner <hpenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Jan 2002 12:30:37 +0000 (12:30 +0000)
        to const_double needs to be done right for big-endian systems.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49180 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/emit-rtl.c

index 08bba7f..9bd5fe4 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-14  Hartmut Penner  <hpenner@de.ibm.com>
+
+       * emit_rtl.c (gen_lowpart_common): Conversion from const_int 
+       to const_double needs to be done right for big-endian systems.
+
 2002-01-24  Jason Merrill  <jason@redhat.com>
 
        * config/sparc/sparc.md (call-jump peepholes): Pass the right insn
index c3b8ddc..28e0dd9 100644 (file)
@@ -919,13 +919,11 @@ gen_lowpart_common (mode, x)
        low = INTVAL (x), high = low >> (HOST_BITS_PER_WIDE_INT -1);
       else
        low = CONST_DOUBLE_LOW (x), high = CONST_DOUBLE_HIGH (x);
-
 #ifdef HOST_WORDS_BIG_ENDIAN
       u.i[0] = high, u.i[1] = low;
 #else
       u.i[0] = low, u.i[1] = high;
 #endif
-
       return CONST_DOUBLE_FROM_REAL_VALUE (u.d, mode);
     }
 
@@ -1009,12 +1007,16 @@ gen_lowpart_common (mode, x)
          high = CONST_DOUBLE_HIGH (x);
        }
 
+#if HOST_BITS_PER_WIDE_INT == 32
       /* REAL_VALUE_TARGET_DOUBLE takes the addressing order of the
         target machine.  */
       if (WORDS_BIG_ENDIAN)
        i[0] = high, i[1] = low;
       else
        i[0] = low, i[1] = high;
+#else
+      i[0] = low;
+#endif
 
       r = REAL_VALUE_FROM_TARGET_DOUBLE (i);
       return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);