A few linux/alpha bugs

Jim Wilson wilson@chestnut.cygnus.com
Tue Sep 2 12:35:00 GMT 1997


Here is a patch to fix this problem.

Tue Sep  2 12:00:36 1997  Jim Wilson  <wilson@cygnus.com>

	* alpha/alpha.h (PREFERRED_RELOAD_CLASS): Return NO_REGS if NO_REGS
	is passed in.
	* emit-rtl.c (gen_lowpart_common): Add code to convert CONST_INT to
	SFmode for 64 bit hosts.
	
diff -pr orig-egcs-970828/gcc/config/alpha/alpha.h egcs-970828/gcc/config/alpha/alpha.h
*** orig-egcs-970828/gcc/config/alpha/alpha.h	Thu Aug 21 17:47:57 1997
--- egcs-970828/gcc/config/alpha/alpha.h	Tue Sep  2 11:18:19 1997
*************** enum reg_class { NO_REGS, GENERAL_REGS, 
*** 691,697 ****
  
  #define PREFERRED_RELOAD_CLASS(X, CLASS)		\
    (CONSTANT_P (X) && (X) != const0_rtx && (X) != CONST0_RTX (GET_MODE (X)) \
!    ? ((CLASS) == FLOAT_REGS ? NO_REGS : GENERAL_REGS)			\
     : (CLASS))
  
  /* Loading and storing HImode or QImode values to and from memory
--- 691,697 ----
  
  #define PREFERRED_RELOAD_CLASS(X, CLASS)		\
    (CONSTANT_P (X) && (X) != const0_rtx && (X) != CONST0_RTX (GET_MODE (X)) \
!    ? ((CLASS) == FLOAT_REGS || (CLASS) == NO_REGS ? NO_REGS : GENERAL_REGS)\
     : (CLASS))
  
  /* Loading and storing HImode or QImode values to and from memory
*** orig-egcs-970828/gcc/emit-rtl.c	Mon Aug 11 08:57:06 1997
--- egcs-970828/gcc/emit-rtl.c	Tue Sep  2 11:57:31 1997
*************** gen_lowpart_common (mode, x)
*** 809,814 ****
--- 809,834 ----
        return CONST_DOUBLE_FROM_REAL_VALUE (u.d, mode);
      }
  #endif
+ 
+   /* We need an extra case for machines where HOST_BITS_PER_WIDE_INT is the
+      same as sizeof (double), such as the alpha.  We only handle the
+      REAL_ARITHMETIC case, which is easy.  Testing HOST_BITS_PER_WIDE_INT
+      is not strictly necessary, but is done to restrict this code to cases
+      where it is known to work.  */
+ #ifdef REAL_ARITHMETIC
+   else if (mode == SFmode
+ 	   && GET_CODE (x) == CONST_INT
+ 	   && GET_MODE_BITSIZE (mode) * 2 == HOST_BITS_PER_WIDE_INT)
+     {
+       REAL_VALUE_TYPE r;
+       HOST_WIDE_INT i;
+ 
+       i = INTVAL (x);
+       r = REAL_VALUE_FROM_TARGET_SINGLE (i);
+       return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);
+     }
+ #endif
+ 
    /* Similarly, if this is converting a floating-point value into a
       single-word integer.  Only do this is the host and target parameters are
       compatible.  */



More information about the Gcc mailing list