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]

Patch to fix set_unique_reg_note


Some set_unique_reg_note callers assume that single_set
means an insn only has one set so it's okay to add a
REG_EQUAL or REG_EQUIV note.  However single_set just
means that the insn has only * useful * set.

This patch passes make bootstrap and make check on
Dec Alpha 4.0f, Solaris 7 SPARC, and Solaris 7 x86.

ChangeLog:

Sat Dec  1 20:13:46 EST 2001  John Wehle  (john@feith.com)

	* emit-rtl.c (set_unique_reg_note): Don't set
	a REG_EQUAL or REG_EQUIV note if multiple sets
	are present.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/emit-rtl.c.ORIGINAL	Thu Nov 29 15:26:02 2001
--- gcc/emit-rtl.c	Sat Dec  1 19:59:45 2001
*************** set_unique_reg_note (insn, kind, datum)
*** 3994,4004 ****
  {
    rtx note = find_reg_note (insn, kind, NULL_RTX);
  
!   /* Don't add ASM_OPERAND REG_EQUAL/REG_EQUIV notes.
!      It serves no useful purpose and breaks eliminate_regs.  */
!   if ((kind == REG_EQUAL || kind == REG_EQUIV)
!       && GET_CODE (datum) == ASM_OPERANDS)
!     return NULL_RTX;
  
    if (note)
      {
--- 3994,4023 ----
  {
    rtx note = find_reg_note (insn, kind, NULL_RTX);
  
!   switch (kind)
!     {
!     case REG_EQUAL:
!     case REG_EQUIV:
!       /* Don't add REG_EQUAL/REG_EQUIV notes if the insn
! 	 has multiple sets (some callers assume single_set
! 	 means the insn only has one set, when in fact it
! 	 means the insn only has one * useful * set).  */
!       if (GET_CODE (PATTERN (insn)) == PARALLEL && multiple_sets (insn))
! 	{
! 	  if (note)
! 	    abort ();
! 	  return NULL_RTX;
! 	}
! 
!       /* Don't add ASM_OPERAND REG_EQUAL/REG_EQUIV notes.
! 	 It serves no useful purpose and breaks eliminate_regs.  */
!       if (GET_CODE (datum) == ASM_OPERANDS)
! 	return NULL_RTX;
!       break;
! 
!     default:
!       break;
!     }
  
    if (note)
      {
-------------------------------------------------------------------------
|   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]