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]

fix opt/12441


The block comment immediately above Jan's change explicitly says not to
accept SUBREGs, and why.  This PR is exactly that case.  Shame on you.

The problem is not in reload, per se.  The problem is that with the
way we treat multi-word data types such as DImode, we really will run
out of registers.

This would be safe to pull back to 3.3.3 if someone would like to do
the requisite sanity check build.


r~



        PR opt/12441
        Revert: Sat Mar 30 14:08:55 CET 2002  Jan Hubicka  <jh@suse.cz>
        * i386.c (aligned_operand): Be prepared for SUBREGed registers.
        (ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG.
        (ix86_address_cost): Be prepared for SUBREGed registers.
        (legitimate_address_p): Accept SUBREGed registers.

Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.632
diff -c -p -d -r1.632 i386.c
*** i386.c	6 Jan 2004 17:31:08 -0000	1.632
--- i386.c	9 Jan 2004 02:25:48 -0000
*************** aligned_operand (rtx op, enum machine_mo
*** 4257,4267 ****
    if (! ix86_decompose_address (op, &parts))
      abort ();
  
-   if (parts.base && GET_CODE (parts.base) == SUBREG)
-     parts.base = SUBREG_REG (parts.base);
-   if (parts.index && GET_CODE (parts.index) == SUBREG)
-     parts.index = SUBREG_REG (parts.index);
- 
    /* Look for some component that isn't known to be aligned.  */
    if (parts.index)
      {
--- 4257,4262 ----
*************** ix86_decompose_address (rtx addr, struct
*** 5480,5486 ****
    int retval = 1;
    enum ix86_address_seg seg = SEG_DEFAULT;
  
!   if (REG_P (addr) || GET_CODE (addr) == SUBREG)
      base = addr;
    else if (GET_CODE (addr) == PLUS)
      {
--- 5475,5481 ----
    int retval = 1;
    enum ix86_address_seg seg = SEG_DEFAULT;
  
!   if (GET_CODE (addr) == REG || GET_CODE (addr) == SUBREG)
      base = addr;
    else if (GET_CODE (addr) == PLUS)
      {
*************** ix86_address_cost (rtx x)
*** 5632,5642 ****
    if (!ix86_decompose_address (x, &parts))
      abort ();
  
-   if (parts.base && GET_CODE (parts.base) == SUBREG)
-     parts.base = SUBREG_REG (parts.base);
-   if (parts.index && GET_CODE (parts.index) == SUBREG)
-     parts.index = SUBREG_REG (parts.index);
- 
    /* More complex memory references are better.  */
    if (parts.disp && parts.disp != const0_rtx)
      cost--;
--- 5627,5632 ----
*************** legitimate_address_p (enum machine_mode 
*** 5981,5995 ****
  
    if (base)
      {
-       rtx reg;
        reason_rtx = base;
  
!       if (GET_CODE (base) == SUBREG)
! 	reg = SUBREG_REG (base);
!       else
! 	reg = base;
! 
!       if (GET_CODE (reg) != REG)
  	{
  	  reason = "base is not a register";
  	  goto report_error;
--- 5971,5979 ----
  
    if (base)
      {
        reason_rtx = base;
  
!       if (GET_CODE (base) != REG)
  	{
  	  reason = "base is not a register";
  	  goto report_error;
*************** legitimate_address_p (enum machine_mode 
*** 6001,6008 ****
  	  goto report_error;
  	}
  
!       if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg))
! 	  || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (reg)))
  	{
  	  reason = "base is not valid";
  	  goto report_error;
--- 5985,5992 ----
  	  goto report_error;
  	}
  
!       if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base))
! 	  || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base)))
  	{
  	  reason = "base is not valid";
  	  goto report_error;
*************** legitimate_address_p (enum machine_mode 
*** 6017,6031 ****
  
    if (index)
      {
-       rtx reg;
        reason_rtx = index;
  
!       if (GET_CODE (index) == SUBREG)
! 	reg = SUBREG_REG (index);
!       else
! 	reg = index;
! 
!       if (GET_CODE (reg) != REG)
  	{
  	  reason = "index is not a register";
  	  goto report_error;
--- 6001,6009 ----
  
    if (index)
      {
        reason_rtx = index;
  
!       if (GET_CODE (index) != REG)
  	{
  	  reason = "index is not a register";
  	  goto report_error;
*************** legitimate_address_p (enum machine_mode 
*** 6037,6044 ****
  	  goto report_error;
  	}
  
!       if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg))
! 	  || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (reg)))
  	{
  	  reason = "index is not valid";
  	  goto report_error;
--- 6015,6022 ----
  	  goto report_error;
  	}
  
!       if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (index))
! 	  || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (index)))
  	{
  	  reason = "index is not valid";
  	  goto report_error;


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