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]

Patch to fix rtx_unstable_p & rtx_varies_p handling of vectors


Given:

  (asm_operands ("divl %4") ("=a") 0[ 
          (reg/v:SI 69)
          (reg/v:SI 70)
          (reg/v:SI 67)
      ] 
      [ 
          (asm_input:SI ("0"))
          (asm_input:SI ("1"))
          (asm_input:SI ("rm"))
      ]  ("libgcc2.c") 360)

rtx_unstable_p and rtx_varies_p return 0.  They should check the vectors
and return non-zero.  This patch passes make bootstrap and make check
on Compaq Tru64 UNIX 4.0f and FreeBSD-3.5 x86.

ChangeLog:

Tue Aug 15 20:20:40 EDT 2000  John Wehle  (john@feith.com)

	* rtlanal.c (rtx_unstable_p): Process vectors.
	(rtx_varies_p): Likewise.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/rtlanal.c.ORIGINAL	Mon Aug 14 18:26:00 2000
--- gcc/rtlanal.c	Tue Aug 15 19:47:46 2000
*************** rtx_unstable_p (x)
*** 70,77 ****
    fmt = GET_RTX_FORMAT (code);
    for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
      if (fmt[i] == 'e')
!       if (rtx_unstable_p (XEXP (x, i)))
! 	return 1;
    return 0;
  }
  
--- 70,87 ----
    fmt = GET_RTX_FORMAT (code);
    for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
      if (fmt[i] == 'e')
!       {
! 	if (rtx_unstable_p (XEXP (x, i)))
! 	  return 1;
!       }
!     else if (fmt[i] == 'E')
!       {
! 	int j;
! 	for (j = 0; j < XVECLEN (x, i); j++)
! 	  if (rtx_unstable_p (XVECEXP (x, i, j)))
! 	    return 1;
!       }
! 
    return 0;
  }
  
*************** rtx_varies_p (x)
*** 121,128 ****
    fmt = GET_RTX_FORMAT (code);
    for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
      if (fmt[i] == 'e')
!       if (rtx_varies_p (XEXP (x, i)))
! 	return 1;
    return 0;
  }
  
--- 131,148 ----
    fmt = GET_RTX_FORMAT (code);
    for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
      if (fmt[i] == 'e')
!       {
! 	if (rtx_varies_p (XEXP (x, i)))
! 	  return 1;
!       }
!     else if (fmt[i] == 'E')
!       {
! 	int j;
! 	for (j = 0; j < XVECLEN (x, i); j++)
! 	  if (rtx_varies_p (XVECEXP (x, i, j)))
! 	    return 1;
!       }
! 
    return 0;
  }
  
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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