This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

small reload bug fix for ia64-linux compiler abort on perl


This fixes an ia64-linux compiler abort while compiling perl.
	
Reload is failing while trying to reload a subreg of a general reg that needs
to be reloaded into an FP register because it is a multiply operand.  There
are two problems:
1) There are two places in reload that use CLASS_CANNOT_CHANGE_MODE but not
   CLASS_CANNOT_CHANGE_MODE_P.  This is an oversight from the patch that
   introduced these macros.
2) The IA-64 definition of CLASS_CANNOT_CHANGE_MODE_P is overly strict.  It
   forbids all mode changes.  However, it should only forbid mode changes
   that pun integers with floating point.  Changing SImode to DImode or vice
   versa is OK.

This was tested with a ia64-linux toolchain bootstrap, and an alpha-linux
bootstrap (because ia32 does not use CLASS_CANNOT_CHANGE_MODE) and an alpha
linux make check-gcc.  I couldn't do a complete alpha-linux build and test.
I get assembler errors while building libstdc++, apparently because the
system assembler is too old.  But gcc did bootstrap, and the gcc testsuite
ran OK.
	
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.

Index: reload.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload.c,v
retrieving revision 1.126
diff -p -r1.126 reload.c
*** reload.c	2000/09/07 11:07:07	1.126
--- reload.c	2000/09/08 01:25:51
*************** push_reload (in, out, inloc, outloc, cla
*** 946,952 ****
    if (in != 0 && GET_CODE (in) == SUBREG
        && (SUBREG_WORD (in) == 0 || strict_low)
  #ifdef CLASS_CANNOT_CHANGE_MODE
!       && class != CLASS_CANNOT_CHANGE_MODE
  #endif
        && (CONSTANT_P (SUBREG_REG (in))
  	  || GET_CODE (SUBREG_REG (in)) == PLUS
--- 946,953 ----
    if (in != 0 && GET_CODE (in) == SUBREG
        && (SUBREG_WORD (in) == 0 || strict_low)
  #ifdef 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
*************** push_reload (in, out, inloc, outloc, cla
*** 1051,1057 ****
    if (out != 0 && GET_CODE (out) == SUBREG
        && (SUBREG_WORD (out) == 0 || strict_low)
  #ifdef CLASS_CANNOT_CHANGE_MODE
!       && class != CLASS_CANNOT_CHANGE_MODE
  #endif
        && (CONSTANT_P (SUBREG_REG (out))
  	  || strict_low
--- 1052,1060 ----
    if (out != 0 && GET_CODE (out) == SUBREG
        && (SUBREG_WORD (out) == 0 || strict_low)
  #ifdef 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
Index: config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/ia64.h,v
retrieving revision 1.42
diff -p -r1.42 ia64.h
*** ia64.h	2000/09/05 23:02:58	1.42
--- ia64.h	2000/09/08 01:25:51
*************** enum reg_class
*** 1055,1063 ****
  
  #define CLASS_CANNOT_CHANGE_MODE        FR_REGS
  
! /* Defines illegal mode changes for CLASS_CANNOT_CHANGE_MODE.  */
  
! #define CLASS_CANNOT_CHANGE_MODE_P(FROM,TO) 1
  
  /* A C expression that defines the machine-dependent operand constraint
     letters (`I', `J', `K', .. 'P') that specify particular ranges of
--- 1055,1066 ----
  
  #define CLASS_CANNOT_CHANGE_MODE        FR_REGS
  
! /* 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) \
!   (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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]