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 alpha bootstrap failure


This patch fixes the bootstrap failure reported by Rainer Orth.


Basically we decided to remove an insn with a REG_LIBCALL note, but
not the entire libcall sequence.

Later we decide that the libcall sequence is dead and try to move the
entire sequence.  To do so, we examine the contents of the REG_RETVAL
note to find the start of the sequence -- unfortunately the insn
pointed to by the REG_RETVAL note was deleted earlier.  This results
in a couple interesting problems like trying to delete an insn twice.

This has been bootstrapped and regression tested on i686-pc-linux-gnu; it
has also been bootstrapped on hppa2.0w-hp-hpux11.00 and
alphapca56-unknown-linux-gnu.  Installed into the mainline sources.

	* flow.c (propagate_one_insn): When removing an insn
	with a REG_LIBCALL note but not the entire libcall sequence,
	delete the associated REG_RETVAL note.

Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.534
diff -c -3 -p -r1.534 flow.c
*** flow.c	11 Jun 2002 12:21:33 -0000	1.534
--- flow.c	24 Jun 2002 20:17:20 -0000
*************** propagate_one_insn (pbi, insn)
*** 1650,1671 ****
        else
  	{
  
  	  if (note)
  	    {
- 	      /* If INSN contains a RETVAL note and is dead, but the libcall
- 		 as a whole is not dead, then we want to remove INSN, but
- 		 not the whole libcall sequence.
- 
- 		 However, we need to also remove the dangling REG_LIBCALL	
- 		 note so that we do not have mis-matched LIBCALL/RETVAL
- 		 notes.  In theory we could find a new location for the
- 		 REG_RETVAL note, but it hardly seems worth the effort.  */
  	      rtx libcall_note;
  	 
  	      libcall_note
  		= find_reg_note (XEXP (note, 0), REG_LIBCALL, NULL_RTX);
  	      remove_note (XEXP (note, 0), libcall_note);
  	    }
  	  propagate_block_delete_insn (insn);
  	}
  
--- 1650,1687 ----
        else
  	{
  
+ 	/* If INSN contains a RETVAL note and is dead, but the libcall
+ 	   as a whole is not dead, then we want to remove INSN, but
+ 	   not the whole libcall sequence.
+ 
+ 	   However, we need to also remove the dangling REG_LIBCALL	
+ 	   note so that we do not have mis-matched LIBCALL/RETVAL
+ 	   notes.  In theory we could find a new location for the
+ 	   REG_RETVAL note, but it hardly seems worth the effort. 
+ 
+ 	   NOTE at this point will be the RETVAL note if it exists.  */
  	  if (note)
  	    {
  	      rtx libcall_note;
  	 
  	      libcall_note
  		= find_reg_note (XEXP (note, 0), REG_LIBCALL, NULL_RTX);
  	      remove_note (XEXP (note, 0), libcall_note);
  	    }
+ 
+ 	  /* Similarly if INSN contains a LIBCALL note, remove the
+ 	     dnagling REG_RETVAL note.  */
+ 	  note = find_reg_note (insn, REG_LIBCALL, NULL_RTX);
+ 	  if (note)
+ 	    {
+ 	      rtx retval_note;
+ 
+ 	      retval_note
+ 		= find_reg_note (XEXP (note, 0), REG_RETVAL, NULL_RTX);
+ 	      remove_note (XEXP (note, 0), retval_note);
+ 	    }
+ 
+ 	  /* Now delete INSN.  */
  	  propagate_block_delete_insn (insn);
  	}
  





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