Patch for PR target/21723, hppa 1.0 bootstrap failure

Steve Ellcey sje@cup.hp.com
Thu Jun 30 15:22:00 GMT 2005


Currently on hppa, if HARD_REGNO_NREGS is called with a floating point
register and a complex mode (like SCmode) and TARGET_PA_11 is set to
FALSE, it thinks it can store the complex mode in a single floating
point register.  This will happen when initializing the hard_regno_nregs
array.

This behaviour is incorrect and I think HARD_REGNO_NREGS was set up this
way before the complex modes were introduced into GCC.  This patch makes
it clear that complex modes cannot be put into a single floating point
register regardless of the PA architecture (PA1.0, PA1.1, or PA2.0).

Tested on hppa 1.1 and hppa64 for regressions and on hppa 1.0 to make
sure the test case in the PR works.

OK for checkin?

Steve Ellcey
sje@cup.hp.com


2005-06-30  Steve Ellcey  <sje@cup.hp.com>

	PR target/21723
	* config/pa/pa32-regs.h (HARD_REGNO_NREGS): Fix for TARGET_PA_10.

*** gcc.orig/gcc/config/pa/pa32-regs.h	Thu Jun 30 08:09:22 2005
--- gcc/gcc/config/pa/pa32-regs.h	Thu Jun 30 08:09:12 2005
***************
*** 161,167 ****
     bits wide */
  #define HARD_REGNO_NREGS(REGNO, MODE)					\
    (FP_REGNO_P (REGNO)							\
!    ? (!TARGET_PA_11 ? 1 : (GET_MODE_SIZE (MODE) + 4 - 1) / 4)		\
     : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
  
  /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
--- 161,171 ----
     bits wide */
  #define HARD_REGNO_NREGS(REGNO, MODE)					\
    (FP_REGNO_P (REGNO)							\
!    ? ((!TARGET_PA_11							\
!        && GET_MODE_CLASS (MODE) != MODE_COMPLEX_FLOAT			\
!        && GET_MODE_CLASS (MODE) != MODE_COMPLEX_INT)			\
!      ? 1								\
!      : (GET_MODE_SIZE (MODE) + 4 - 1) / 4)				\
     : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
  
  /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.



More information about the Gcc-patches mailing list