PATCH, rs6000 Fix DF split for 64 bit hosts.

Tom Rix trix@redhat.com
Wed Jan 16 14:23:00 GMT 2002


On 64 bit hosts,  the input from this split to immed_double_const is
incorrect.

Pack both long's into a  HOST_WIDE_INT.

This patch fixes ~100 failures for rs6000 -maix64.
The testcase I was working on specifically was execute/930513-1. c

Tom

--
Tom Rix
GCC Engineer
trix@redhat.com


-------------- next part --------------
2002-01-16  Tom Rix  <trix@redhat.com>

	* config/rs6000/rs6000.md: Fix DF split for 64 bit hosts.
 
diff -rcp gcc-old/gcc/config/rs6000/rs6000.md gcc/gcc/config/rs6000/rs6000.md
*** gcc-old/gcc/config/rs6000/rs6000.md	Tue Jan 15 22:57:55 2002
--- gcc/gcc/config/rs6000/rs6000.md	Tue Jan 15 23:04:40 2002
***************
*** 7927,7939 ****
--- 7927,7947 ----
    int endian = (WORDS_BIG_ENDIAN == 0);
    long l[2];
    REAL_VALUE_TYPE rv;
+   HOST_WIDE_INT val;
  
    REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
    REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
  
    operands[2] = gen_lowpart (DImode, operands[0]);
    /* HIGHPART is lower memory address when WORDS_BIG_ENDIAN.  */
+ #if HOST_BITS_PER_WIDE_INT >= 64
+   val = ((HOST_WIDE_INT)(unsigned long)l[endian] << 32 |
+         ((HOST_WIDE_INT)(unsigned long)l[1 - endian]));
+ 
+   operands[3] = immed_double_const (val, -(val < 0), DImode);
+ #else
    operands[3] = immed_double_const (l[1 - endian], l[endian], DImode);
+ #endif
  }")
  
  ;; Don't have reload use general registers to load a constant.  First,



More information about the Gcc-patches mailing list