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]

Improvement for update_equiv_regs (fwd)


This is an older patch from Joern Rennecke.  The last time I tried, it made
a small improvement for the sh target.

Can I install this?

Bernd

---------- Forwarded message ----------
From: Joern Rennecke <amylaar@cygnus.co.uk>

update_equiv_regs still misses a number of function invariants because
they have no REG_EQUAL notes.

Here is a fix:

Fri Feb  5 09:13:41 1999  J"orn Rennecke <amylaar@cygnus.co.uk>

	* local-alloc.c (update_equiv_regs): If there is no REG_EQUAL note
	on an insn and function_invariant_p returns nonzero for the
	source, add a REG_EQUAL note.

Index: local-alloc.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/local-alloc.c,v
retrieving revision 1.93
diff -p -r1.93 local-alloc.c
*** local-alloc.c	1999/01/15 07:57:38	1.93
--- local-alloc.c	1999/02/05 09:12:36
*************** update_equiv_regs ()
*** 796,801 ****
--- 796,807 ----
  
        note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
  
+       /* cse sometimes generates function invariants, but doesn't put a
+ 	 REG_EQUAL note on the insn.  */
+       if (! note && function_invariant_p (src))
+ 	REG_NOTES (insn)
+ 	  = note = gen_rtx_EXPR_LIST (REG_EQUAL, src, REG_NOTES (insn));
+ 
        if (REG_N_SETS (regno) != 1
  	  && (! note
  	      || ! function_invariant_p (XEXP (note, 0))

----- End of forwarded message from Joern Rennecke -----


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