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]
Other format: [Raw text]

RFA: Add PIC register to call_used_regs array


Hi Jeff, Hi Alex,

  Please may I have permission to apply the following patch ?  It
  fixes a problem with the mn10300 port when the -fpic switch is
  used.  The code in the CONDITIONAL_REGISTER_USAGE macro marks the
  PIC_REG as being fixed but it does not add it to the call_used_regs
  array.  This causes an ICE in regclass.c:init_reg_sets_1() whent he
  register sets are being initialised.

  Tested by building an mn10300-elf toolchain.

Cheers
  Nick
  
2004-10-13  Nick Clifton  <nickc@redhat.com>

	* config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): When
	adding the PIC register to the fixed_regs array, also add it
	to the call_used_regs array.
  
Index: mn10300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mn10300/mn10300.h,v
retrieving revision 1.83
diff -c -3 -p -r1.83 mn10300.h
*** mn10300.h	8 Sep 2004 18:45:14 -0000	1.83
--- mn10300.h	13 Oct 2004 11:00:13 -0000
*************** extern GTY(()) int mn10300_unspec_int_la
*** 215,221 ****
  	fixed_regs[i] = call_used_regs[i] = 1;	\
      }						\
    if (flag_pic)					\
!     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;	\
  }
  
  /* Return number of consecutive hard regs needed starting at reg REGNO
--- 215,222 ----
  	fixed_regs[i] = call_used_regs[i] = 1;	\
      }						\
    if (flag_pic)					\
!     fixed_regs[PIC_OFFSET_TABLE_REGNUM] =       \
!     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;\
  }
  
  /* Return number of consecutive hard regs needed starting at reg REGNO


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