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]

Minor calls.c bug


This fixes a bug that occurs when the initialization of a "constant"
BLKmode object occurs within a loop via a call to a function.  Without
adding an explicit CLOBBER, we can hoist a reference to that variable
outside the loop.

Thu Mar 23 17:10:48 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* calls.c (expand_call): If TARGET is passed by reference and
	is readonly, write a CLOBBER.

*** calls.c	2000/03/23 00:40:56	1.101
--- calls.c	2000/03/23 22:09:52
*************** expand_call (exp, target, ignore)
*** 2777,2780 ****
--- 2777,2788 ----
  	current_function_calls_longjmp = 1, sibcall_failure = 1;
  
+       /* If this function is returning into a memory location marked as
+ 	 readonly, it means it is initializing that location.  But we normally
+ 	 treat functions as not clobbering such locations, so we need to
+ 	 specify that this one does.  */
+       if (target != 0 && GET_CODE (target) == MEM
+ 	  && structure_value_addr != 0 && RTX_UNCHANGING_P (target))
+ 	emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
+ 
        /* If value type not void, return an rtx for the value.  */
  

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