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]

Re: Bogus libcalls with multiple REG_RETVAL notes


On Sat, 16 Sep 2000, Richard Henderson wrote:

> On Sat, Sep 16, 2000 at 07:45:03PM +0100, Bernd Schmidt wrote:
> > > All the ones that the user calls, yes.  But there are
> > > functions calls generated by gcc that don't go through
> > > expand_call.
> > 
> > Can you provide an example? 
[ ... ] 

OK, I wasn't aware of that.  How about this patch then?
(It would have helped if someone had put a comment in the code describing
that the problem is known and what the preferred solution would be...)


Bernd

	* expr.h (emit_library_call, emit_library_call_value): Delete
	declarations.
	* rtl.h (enum libcall_type): New.
	(emit_library_call, emit_library_call_value): Change fn_type arg to
	be of type enum libcall_type.
	* calls.c: Likewise for the function definitions.  Several callers
	throughout changed to use the new enumeration appropriately.
	(emit_library_call_value_1): Likewise.  Put back code to make libcall
	blocks of equal form, but only use it for the two new higher
	enumeration values.

Index: builtins.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/builtins.c,v
retrieving revision 1.55
diff -u -p -r1.55 builtins.c
--- builtins.c	2000/09/12 16:14:22	1.55
+++ builtins.c	2000/09/16 19:36:15
@@ -1388,8 +1388,8 @@ expand_builtin_strlen (exp, target, mode
 
       /* Check the string is readable and has an end.  */
       if (current_function_check_memory_usage)
-	emit_library_call (chkr_check_str_libfunc, 1, VOIDmode, 2,
-			   src_reg, Pmode,
+	emit_library_call (chkr_check_str_libfunc, LCT_CONST_MAKE_BLOCK,
+			   VOIDmode, 2, src_reg, Pmode,
 			   GEN_INT (MEMORY_USE_RO),
 			   TYPE_MODE (integer_type_node));
 
@@ -1468,8 +1468,8 @@ expand_builtin_memcpy (arglist)
 
       /* Just copy the rights of SRC to the rights of DEST.  */
       if (current_function_check_memory_usage)
-	emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3,
-			   XEXP (dest_mem, 0), Pmode,
+	emit_library_call (chkr_copy_bitmap_libfunc, LCT_CONST_MAKE_BLOCK,
+			   VOIDmode, 3, XEXP (dest_mem, 0), Pmode,
 			   XEXP (src_mem, 0), Pmode,
 			   len_rtx, TYPE_MODE (sizetype));
 
@@ -1574,8 +1574,8 @@ expand_builtin_memset (exp)
 	   
       /* Just check DST is writable and mark it as readable.  */
       if (current_function_check_memory_usage)
-	emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3,
-			   XEXP (dest_mem, 0), Pmode,
+	emit_library_call (chkr_check_addr_libfunc, LCT_CONST_MAKE_BLOCK,
+			   VOIDmode, 3, XEXP (dest_mem, 0), Pmode,
 			   len_rtx, TYPE_MODE (sizetype),
 			   GEN_INT (MEMORY_USE_WO),
 			   TYPE_MODE (integer_type_node));
@@ -1687,7 +1687,7 @@ expand_builtin_memcmp (exp, arglist, tar
     if (insn)
       emit_insn (insn);
     else
-      emit_library_call_value (memcmp_libfunc, result, 2,
+      emit_library_call_value (memcmp_libfunc, result, LCT_PURE_MAKE_BLOCK,
 			       TYPE_MODE (integer_type_node), 3,
 			       XEXP (arg1_rtx, 0), Pmode,
 			       XEXP (arg2_rtx, 0), Pmode,
Index: calls.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/calls.c,v
retrieving revision 1.157
diff -u -p -r1.157 calls.c
--- calls.c	2000/09/15 16:21:53	1.157
+++ calls.c	2000/09/16 19:36:17
@@ -219,7 +219,8 @@ static rtx rtx_for_function_call		PARAMS
 static void load_register_parameters		PARAMS ((struct arg_data *,
 							 int, rtx *, int));
 static int libfunc_nothrow			PARAMS ((rtx));
-static rtx emit_library_call_value_1 		PARAMS ((int, rtx, rtx, int,
+static rtx emit_library_call_value_1 		PARAMS ((int, rtx, rtx,
+							 enum libcall_type,
 							 enum machine_mode,
 							 int, va_list));
 static int special_function_p			PARAMS ((tree, int));
@@ -1678,9 +1679,8 @@ rtx_for_function_call (fndecl, exp)
 	     that this seems safer.  */
 	  funaddr = convert_memory_address (Pmode, funexp);
 #endif
-	  emit_library_call (chkr_check_exec_libfunc, 1,
-			     VOIDmode, 1,
-			     funaddr, Pmode);
+	  emit_library_call (chkr_check_exec_libfunc, LCT_CONST_MAKE_BLOCK,
+			     VOIDmode, 1, funaddr, Pmode);
 	}
       emit_queue ();
     }
@@ -3026,7 +3026,7 @@ expand_call (exp, target, ignore)
 
 	  /* Mark the memory for the aggregate as write-only.  */
 	  if (current_function_check_memory_usage)
-	    emit_library_call (chkr_set_right_libfunc, 1,
+	    emit_library_call (chkr_set_right_libfunc, LCT_CONST_MAKE_BLOCK,
 			       VOIDmode, 3,
 			       structure_value_addr, ptr_mode,
 			       GEN_INT (struct_value_size),
@@ -3465,7 +3465,7 @@ emit_library_call_value_1 (retval, orgfu
      int retval;
      rtx orgfun;
      rtx value;
-     int fn_type;
+     enum libcall_type fn_type;
      enum machine_mode outmode;
      int nargs;
      va_list p;
@@ -3521,9 +3521,9 @@ emit_library_call_value_1 (retval, orgfu
 #endif
 #endif
 
-  if (fn_type == 1)
+  if (fn_type == LCT_CONST_MAKE_BLOCK)
     flags |= ECF_CONST;
-  else if (fn_type == 2)
+  else if (fn_type == LCT_PURE_MAKE_BLOCK)
     flags |= ECF_PURE;
   fun = orgfun;
 
@@ -3580,6 +3580,11 @@ emit_library_call_value_1 (retval, orgfu
 
   count = 0;
 
+  /* Now we are about to start emitting insns that can be deleted
+     if a libcall is deleted.  */
+  if (flags & (ECF_CONST | ECF_PURE))
+    start_sequence ();
+
   push_temp_slots ();
 
   /* If there's a structure value address to be passed,
@@ -4017,6 +4022,45 @@ emit_library_call_value_1 (retval, orgfu
   /* Now restore inhibit_defer_pop to its actual original value.  */
   OK_DEFER_POP;
 
+  /* If call is cse'able, make appropriate pair of reg-notes around it.
+     Test valreg so we don't crash; may safely ignore `const'
+     if return type is void.  Disable for PARALLEL return values, because
+     we have no way to move such values into a pseudo register.  */
+  if ((flags & (ECF_CONST | ECF_PURE))
+      && valreg != 0 && GET_CODE (valreg) != PARALLEL)
+    {
+      rtx note = 0;
+      rtx temp = gen_reg_rtx (GET_MODE (valreg));
+      rtx insns;
+      int i;
+
+      /* Construct an "equal form" for the value which mentions all the
+	 arguments in order as well as the function name.  */
+      for (i = 0; i < nargs; i++)
+	note = gen_rtx_EXPR_LIST (VOIDmode, argvec[i].value, note);
+      note = gen_rtx_EXPR_LIST (VOIDmode, fun, note);
+
+      insns = get_insns ();
+      end_sequence ();
+
+      if (flags & ECF_PURE)
+	note = gen_rtx_EXPR_LIST (VOIDmode,
+	   gen_rtx_USE (VOIDmode,
+			gen_rtx_MEM (BLKmode,
+				     gen_rtx_SCRATCH (VOIDmode))), note);
+
+      emit_libcall_block (insns, temp, valreg, note);
+
+      valreg = temp;
+    }
+  else if (flags & (ECF_CONST | ECF_PURE))
+    {
+      /* Otherwise, just write out the sequence without a note.  */
+      rtx insns = get_insns ();
+
+      end_sequence ();
+      emit_insns (insns);
+    }
   pop_temp_slots ();
 
   /* Copy the value to the right place.  */
@@ -4098,8 +4142,8 @@ emit_library_call_value_1 (retval, orgfu
    (use (memory (scratch)).  */
 
 void
-emit_library_call VPARAMS((rtx orgfun, int fn_type, enum machine_mode outmode,
-			   int nargs, ...))
+emit_library_call VPARAMS((rtx orgfun, enum libcall_type fn_type,
+			   enum machine_mode outmode, int nargs, ...))
 {
 #ifndef ANSI_PROTOTYPES
   rtx orgfun;
@@ -4132,7 +4176,8 @@ emit_library_call VPARAMS((rtx orgfun, i
    If VALUE is nonzero, VALUE is returned.  */
 
 rtx
-emit_library_call_value VPARAMS((rtx orgfun, rtx value, int fn_type,
+emit_library_call_value VPARAMS((rtx orgfun, rtx value,
+				 enum libcall_type fn_type,
 				 enum machine_mode outmode, int nargs, ...))
 {
 #ifndef ANSI_PROTOTYPES
@@ -4376,8 +4421,8 @@ store_one_arg (arg, argblock, flags, var
       /* If the value is already in the stack slot, we are done.  */
       if (current_function_check_memory_usage && GET_CODE (arg->stack) == MEM)
 	{
-	  emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
-			     XEXP (arg->stack, 0), Pmode,
+	  emit_library_call (chkr_set_right_libfunc, LCT_CONST_MAKE_BLOCK,
+			     VOIDmode, 3, XEXP (arg->stack, 0), Pmode,
 			     ARGS_SIZE_RTX (arg->size),
 			     TYPE_MODE (sizetype),
 			     GEN_INT (MEMORY_USE_RW),
Index: except.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/except.c,v
retrieving revision 1.134
diff -u -p -r1.134 except.c
--- except.c	2000/05/31 12:37:38	1.134
+++ except.c	2000/09/16 19:36:18
@@ -1363,7 +1363,7 @@ start_dynamic_handler ()
   buf = plus_constant (XEXP (arg, 0), GET_MODE_SIZE (Pmode)*2);
 
 #ifdef DONT_USE_BUILTIN_SETJMP
-  x = emit_library_call_value (setjmp_libfunc, NULL_RTX, 1,
+  x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_CONST,
 			       TYPE_MODE (integer_type_node), 1,
 			       buf, Pmode);
   /* If we come back here for a catch, transfer control to the handler.  */
@@ -1761,7 +1761,8 @@ start_catch_handler (rtime)
 
       /* Now issue the call, and branch around handler if needed */
       call_rtx = emit_library_call_value (eh_rtime_match_libfunc, NULL_RTX, 
-                                          0, TYPE_MODE (integer_type_node),
+                                          LCT_NORMAL,
+					  TYPE_MODE (integer_type_node),
 				          1, rtime_address, Pmode);
 
       /* Did the function return true? */
Index: expr.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/expr.c,v
retrieving revision 1.260
diff -u -p -r1.260 expr.c
--- expr.c	2000/09/15 16:16:33	1.260
+++ expr.c	2000/09/16 19:36:21
@@ -804,7 +804,7 @@ convert_move (to, from, unsignedp)
 	abort ();
 
       start_sequence ();
-      value = emit_library_call_value (libcall, NULL_RTX, 1, to_mode,
+      value = emit_library_call_value (libcall, NULL_RTX, LCT_CONST, to_mode,
 				       1, from, from_mode);
       insns = get_insns ();
       end_sequence ();
@@ -1777,7 +1777,7 @@ emit_block_move (x, y, size, align)
 
       retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0);
 #else
-      emit_library_call (bcopy_libfunc, 0,
+      emit_library_call (bcopy_libfunc, LCT_NORMAL,
 			 VOIDmode, 3, y, Pmode, x, Pmode,
 			 convert_to_mode (TYPE_MODE (integer_type_node), size,
 					  TREE_UNSIGNED (integer_type_node)),
@@ -2548,7 +2548,7 @@ clear_storage (object, size, align)
 
 	  retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0);
 #else
-	  emit_library_call (bzero_libfunc, 0,
+	  emit_library_call (bzero_libfunc, LCT_NORMAL,
 			     VOIDmode, 2, object, Pmode, size,
 			     TYPE_MODE (integer_type_node));
 #endif
@@ -3052,15 +3052,15 @@ emit_push_insn (x, mode, type, size, ali
 	      in_check_memory_usage = 1;
 	      temp = get_push_address (INTVAL (size) - used);
 	      if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type))
-		emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3,
-				   temp, Pmode,
-				   XEXP (xinner, 0), Pmode,
+		emit_library_call (chkr_copy_bitmap_libfunc,
+				   LCT_CONST_MAKE_BLOCK, VOIDmode, 3, temp,
+				   Pmode, XEXP (xinner, 0), Pmode,
 				   GEN_INT (INTVAL (size) - used),
 				   TYPE_MODE (sizetype));
 	      else
-		emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
-				   temp, Pmode,
-			 	   GEN_INT (INTVAL (size) - used),
+		emit_library_call (chkr_set_right_libfunc,
+				   LCT_CONST_MAKE_BLOCK, VOIDmode, 3, temp,
+				   Pmode, GEN_INT (INTVAL (size) - used),
 				   TYPE_MODE (sizetype),
 				   GEN_INT (MEMORY_USE_RW),
 				   TYPE_MODE (integer_type_node));
@@ -3109,12 +3109,14 @@ emit_push_insn (x, mode, type, size, ali
 	      in_check_memory_usage = 1;
 	      target = copy_to_reg (temp);
 	      if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type))
-		emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3,
+		emit_library_call (chkr_copy_bitmap_libfunc,
+				   LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
 				   target, Pmode,
 				   XEXP (xinner, 0), Pmode,
 				   size, TYPE_MODE (sizetype));
 	      else
-	        emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
+	        emit_library_call (chkr_set_right_libfunc,
+				   LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
 				   target, Pmode,
 			 	   size, TYPE_MODE (sizetype),
 				   GEN_INT (MEMORY_USE_RW),
@@ -3201,13 +3203,13 @@ emit_push_insn (x, mode, type, size, ali
 	     to force it to pop the bcopy-arguments right away.  */
 	  NO_DEFER_POP;
 #ifdef TARGET_MEM_FUNCTIONS
-	  emit_library_call (memcpy_libfunc, 0,
+	  emit_library_call (memcpy_libfunc, LCT_NORMAL,
 			     VOIDmode, 3, temp, Pmode, XEXP (xinner, 0), Pmode,
 			     convert_to_mode (TYPE_MODE (sizetype),
 					      size, TREE_UNSIGNED (sizetype)),
 			     TYPE_MODE (sizetype));
 #else
-	  emit_library_call (bcopy_libfunc, 0,
+	  emit_library_call (bcopy_libfunc, LCT_NORMAL,
 			     VOIDmode, 3, XEXP (xinner, 0), Pmode, temp, Pmode,
 			     convert_to_mode (TYPE_MODE (integer_type_node),
 					      size,
@@ -3331,15 +3333,15 @@ emit_push_insn (x, mode, type, size, ali
 	    target = get_push_address (GET_MODE_SIZE (mode));
 
 	  if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type))
-	    emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3,
-			       target, Pmode,
-			       XEXP (x, 0), Pmode,
+	    emit_library_call (chkr_copy_bitmap_libfunc,
+			       LCT_CONST_MAKE_BLOCK, VOIDmode, 3, target,
+			       Pmode, XEXP (x, 0), Pmode,
 			       GEN_INT (GET_MODE_SIZE (mode)),
 			       TYPE_MODE (sizetype));
 	  else
-	    emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
-			       target, Pmode,
-			       GEN_INT (GET_MODE_SIZE (mode)),
+	    emit_library_call (chkr_set_right_libfunc,
+			       LCT_CONST_MAKE_BLOCK, VOIDmode, 3, target,
+			       Pmode, GEN_INT (GET_MODE_SIZE (mode)),
 			       TYPE_MODE (sizetype),
 			       GEN_INT (MEMORY_USE_RW),
 			       TYPE_MODE (integer_type_node));
@@ -3540,8 +3542,8 @@ expand_assignment (to, from, want_value,
 	  /* Check the access right of the pointer.  */
 	  in_check_memory_usage = 1;
 	  if (size)
-	    emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3,
-			       to_addr, Pmode,
+	    emit_library_call (chkr_check_addr_libfunc, LCT_CONST_MAKE_BLOCK,
+			       VOIDmode, 3, to_addr, Pmode,
 			       GEN_INT (size), TYPE_MODE (sizetype),
 			       GEN_INT (MEMORY_USE_WO),
 			       TYPE_MODE (integer_type_node));
@@ -3684,22 +3686,22 @@ expand_assignment (to, from, want_value,
 
       /* Copy the rights of the bitmap.  */
       if (current_function_check_memory_usage)
-	emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3,
-			   XEXP (to_rtx, 0), Pmode,
+	emit_library_call (chkr_copy_bitmap_libfunc, LCT_CONST_MAKE_BLOCK,
+			   VOIDmode, 3, XEXP (to_rtx, 0), Pmode,
 			   XEXP (from_rtx, 0), Pmode,
 			   convert_to_mode (TYPE_MODE (sizetype),
 					    size, TREE_UNSIGNED (sizetype)),
 			   TYPE_MODE (sizetype));
 
 #ifdef TARGET_MEM_FUNCTIONS
-      emit_library_call (memcpy_libfunc, 0,
+      emit_library_call (memcpy_libfunc, LCT_NORMAL,
 			 VOIDmode, 3, XEXP (to_rtx, 0), Pmode,
 			 XEXP (from_rtx, 0), Pmode,
 			 convert_to_mode (TYPE_MODE (sizetype),
 					  size, TREE_UNSIGNED (sizetype)),
 			 TYPE_MODE (sizetype));
 #else
-      emit_library_call (bcopy_libfunc, 0,
+      emit_library_call (bcopy_libfunc, LCT_NORMAL,
 			 VOIDmode, 3, XEXP (from_rtx, 0), Pmode,
 			 XEXP (to_rtx, 0), Pmode,
 			 convert_to_mode (TYPE_MODE (integer_type_node),
@@ -3924,13 +3926,13 @@ store_expr (exp, target, want_value)
     {
       in_check_memory_usage = 1;
       if (GET_CODE (temp) == MEM)
-	emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3,
-			   XEXP (target, 0), Pmode,
+	emit_library_call (chkr_copy_bitmap_libfunc, LCT_CONST_MAKE_BLOCK,
+			   VOIDmode, 3, XEXP (target, 0), Pmode,
 			   XEXP (temp, 0), Pmode,
 			   expr_size (exp), TYPE_MODE (sizetype));
       else
-	emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3,
-			   XEXP (target, 0), Pmode,
+	emit_library_call (chkr_check_addr_libfunc, LCT_CONST_MAKE_BLOCK,
+			   VOIDmode, 3, XEXP (target, 0), Pmode,
 			   expr_size (exp), TYPE_MODE (sizetype),
 			   GEN_INT (MEMORY_USE_WO),
 			   TYPE_MODE (integer_type_node));
@@ -4044,7 +4046,8 @@ store_expr (exp, target, want_value)
 		  /* Be sure we can write on ADDR.  */
 		  in_check_memory_usage = 1;
 		  if (current_function_check_memory_usage)
-		    emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3,
+		    emit_library_call (chkr_check_addr_libfunc,
+				       LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
 				       addr, Pmode,
 				       size, TYPE_MODE (sizetype),
  				       GEN_INT (MEMORY_USE_WO),
@@ -4787,7 +4790,7 @@ store_constructor (exp, target, align, c
 	      && (startb = TREE_INT_CST_LOW (startbit)) % BITS_PER_UNIT == 0
 	      && (endb = TREE_INT_CST_LOW (endbit) + 1) % BITS_PER_UNIT == 0)
 	    {
-	      emit_library_call (memset_libfunc, 0,
+	      emit_library_call (memset_libfunc, LCT_NORMAL,
 				 VOIDmode, 3,
 				 plus_constant (XEXP (targetx, 0),
 						startb / BITS_PER_UNIT),
@@ -4799,8 +4802,8 @@ store_constructor (exp, target, align, c
 	  else
 #endif
 	    emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__setbits"),
-			       0, VOIDmode, 4, XEXP (targetx, 0), Pmode,
-			       bitlength_rtx, TYPE_MODE (sizetype),
+			       LCT_NORMAL, VOIDmode, 4, XEXP (targetx, 0),
+			       Pmode, bitlength_rtx, TYPE_MODE (sizetype),
 			       startbit_rtx, TYPE_MODE (sizetype),
 			       endbit_rtx, TYPE_MODE (sizetype));
 
@@ -5991,7 +5994,8 @@ expand_expr (exp, target, tmode, modifie
 
 	  in_check_memory_usage = 1;
 	  if (memory_usage != MEMORY_USE_DONT)
-	    emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3,
+	    emit_library_call (chkr_check_addr_libfunc,
+			       LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
 			       XEXP (DECL_RTL (exp), 0), Pmode,
 			       GEN_INT (int_size_in_bytes (type)),
 			       TYPE_MODE (sizetype),
@@ -6509,9 +6513,9 @@ expand_expr (exp, target, tmode, modifie
             if (memory_usage != MEMORY_USE_DONT)
 	      {
 		in_check_memory_usage = 1;
-		emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3,
-				   op0, Pmode,
-				   GEN_INT (int_size_in_bytes (type)),
+		emit_library_call (chkr_check_addr_libfunc,
+				   LCT_CONST_MAKE_BLOCK, VOIDmode, 3, op0,
+				   Pmode, GEN_INT (int_size_in_bytes (type)),
 				   TYPE_MODE (sizetype),
 				   GEN_INT (memory_usage),
 				   TYPE_MODE (integer_type_node));
@@ -6822,9 +6826,9 @@ expand_expr (exp, target, tmode, modifie
         	/* Check the access right of the pointer.  */
 		in_check_memory_usage = 1;
 		if (size > BITS_PER_UNIT)
-		  emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3,
-				     to, Pmode,
-				     GEN_INT (size / BITS_PER_UNIT),
+		  emit_library_call (chkr_check_addr_libfunc,
+				     LCT_CONST_MAKE_BLOCK, VOIDmode, 3, to,
+				     Pmode, GEN_INT (size / BITS_PER_UNIT),
 				     TYPE_MODE (sizetype),
 				     GEN_INT (memory_usage),
 				     TYPE_MODE (integer_type_node));
@@ -8790,7 +8794,8 @@ expand_expr_unaligned (exp, palign)
 	    /* Check the access right of the pointer.  */
 	    in_check_memory_usage = 1;
 	    if (size > BITS_PER_UNIT)
-	      emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3,
+	      emit_library_call (chkr_check_addr_libfunc,
+				 LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
 				 to, ptr_mode, GEN_INT (size / BITS_PER_UNIT),
 				 TYPE_MODE (sizetype),
 				 GEN_INT (MEMORY_USE_RO),
Index: expr.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/expr.h,v
retrieving revision 1.66
diff -u -p -r1.66 expr.h
--- expr.h	2000/07/27 15:54:27	1.66
+++ expr.h	2000/09/16 19:36:21
@@ -1017,11 +1017,6 @@ extern void emit_push_insn PARAMS ((rtx,
 				    unsigned int, int, rtx, int, rtx, rtx,
 				    int, rtx));
 
-/* Emit library call.  */
-extern void emit_library_call PARAMS ((rtx, int, enum machine_mode, int, ...));
-extern rtx emit_library_call_value PARAMS ((rtx, rtx, int, enum machine_mode,
-					    int, ...));
-
 /* Expand an assignment that stores the value of FROM into TO. */
 extern rtx expand_assignment PARAMS ((tree, tree, int, int));
 
Index: function.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/function.c,v
retrieving revision 1.217
diff -u -p -r1.217 function.c
--- function.c	2000/09/01 01:03:29	1.217
+++ function.c	2000/09/16 19:36:23
@@ -1453,8 +1453,8 @@ put_var_into_stack (decl)
     return;
 
   if (current_function_check_memory_usage)
-    emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
-		       XEXP (reg, 0), Pmode,
+    emit_library_call (chkr_set_right_libfunc, LCT_CONST_MAKE_BLOCK, VOIDmode,
+		       3, XEXP (reg, 0), Pmode,
 		       GEN_INT (GET_MODE_SIZE (GET_MODE (reg))),
 		       TYPE_MODE (sizetype),
 		       GEN_INT (MEMORY_USE_RW),
@@ -4684,7 +4684,8 @@ assign_parms (fndecl)
 	      store_expr (parm, copy, 0);
 	      emit_move_insn (parmreg, XEXP (copy, 0));
 	      if (current_function_check_memory_usage)
-		emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
+		emit_library_call (chkr_set_right_libfunc,
+				   LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
 				   XEXP (copy, 0), Pmode,
 				   GEN_INT (int_size_in_bytes (type)),
 				   TYPE_MODE (sizetype),
@@ -4848,8 +4849,8 @@ assign_parms (fndecl)
 	  if (current_function_check_memory_usage)
 	    {
 	      push_to_sequence (conversion_insns);
-	      emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
-				 XEXP (stack_parm, 0), Pmode,
+	      emit_library_call (chkr_set_right_libfunc, LCT_CONST_MAKE_BLOCK,
+				 VOIDmode, 3, XEXP (stack_parm, 0), Pmode,
 				 GEN_INT (GET_MODE_SIZE (GET_MODE
 							 (entry_parm))),
 				 TYPE_MODE (sizetype),
Index: optabs.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/optabs.c,v
retrieving revision 1.79
diff -u -p -r1.79 optabs.c
--- optabs.c	2000/09/15 15:35:03	1.79
+++ optabs.c	2000/09/16 19:36:24
@@ -1692,7 +1692,7 @@ expand_binop (mode, binoptab, op0, op1, 
       /* Pass 1 for NO_QUEUE so we don't lose any increments
 	 if the libcall is cse'd or moved.  */
       value = emit_library_call_value (binoptab->handlers[(int) mode].libfunc,
-				       NULL_RTX, 1, mode, 2,
+				       NULL_RTX, LCT_CONST, mode, 2,
 				       op0, mode, op1x, op1_mode);
 
       insns = get_insns ();
@@ -2175,7 +2175,7 @@ expand_unop (mode, unoptab, op0, target,
       /* Pass 1 for NO_QUEUE so we don't lose any increments
 	 if the libcall is cse'd or moved.  */
       value = emit_library_call_value (unoptab->handlers[(int) mode].libfunc,
-				       NULL_RTX, 1, mode, 1, op0, mode);
+				       NULL_RTX, LCT_CONST, mode, 1, op0, mode);
       insns = get_insns ();
       end_sequence ();
 
@@ -2493,7 +2493,7 @@ expand_complex_abs (mode, op0, target, u
       /* Pass 1 for NO_QUEUE so we don't lose any increments
 	 if the libcall is cse'd or moved.  */
       value = emit_library_call_value (abs_optab->handlers[(int) mode].libfunc,
-				       NULL_RTX, 1, submode, 1, op0, mode);
+				       NULL_RTX, LCT_CONST, submode, 1, op0, mode);
       insns = get_insns ();
       end_sequence ();
 
@@ -3032,14 +3032,14 @@ prepare_cmp_insn (px, py, pcomparison, s
 #endif
 	{
 #ifdef TARGET_MEM_FUNCTIONS
-	  emit_library_call (memcmp_libfunc, 2,
+	  emit_library_call (memcmp_libfunc, LCT_PURE_MAKE_BLOCK,
 			     TYPE_MODE (integer_type_node), 3,
 			     XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
 			     convert_to_mode (TYPE_MODE (sizetype), size,
 					      TREE_UNSIGNED (sizetype)),
 			     TYPE_MODE (sizetype));
 #else
-	  emit_library_call (bcmp_libfunc, 2,
+	  emit_library_call (bcmp_libfunc, LCT_PURE_MAKE_BLOCK,
 			     TYPE_MODE (integer_type_node), 3,
 			     XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
 			     convert_to_mode (TYPE_MODE (integer_type_node),
@@ -3486,7 +3486,8 @@ prepare_float_lib_cmp (px, py, pcomparis
   if (libfunc == 0)
     abort ();
 
-  emit_library_call (libfunc, 1, word_mode, 2, x, mode, y, mode);
+  emit_library_call (libfunc, LCT_CONST_MAKE_BLOCK, word_mode, 2, x, mode, y,
+		     mode);
 
   /* Immediately move the result of the libcall into a pseudo
      register so reload doesn't clobber the value if it needs
@@ -4110,9 +4111,9 @@ expand_float (to, from, unsignedp)
 
       start_sequence ();
 
-      value = emit_library_call_value (libfcn, NULL_RTX, 1,
-				       GET_MODE (to),
-				       1, from, GET_MODE (from));
+      value = emit_library_call_value (libfcn, NULL_RTX, LCT_CONST,
+				       GET_MODE (to), 1, from,
+				       GET_MODE (from));
       insns = get_insns ();
       end_sequence ();
 
@@ -4344,9 +4345,9 @@ expand_fix (to, from, unsignedp)
 
       start_sequence ();
 
-      value = emit_library_call_value (libfcn, NULL_RTX, 1, GET_MODE (to),
-
-				       1, from, GET_MODE (from));
+      value = emit_library_call_value (libfcn, NULL_RTX, LCT_CONST,
+				       GET_MODE (to), 1, from,
+				       GET_MODE (from));
       insns = get_insns ();
       end_sequence ();
 
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/rtl.h,v
retrieving revision 1.223
diff -u -p -r1.223 rtl.h
--- rtl.h	2000/09/13 19:34:05	1.223
+++ rtl.h	2000/09/16 19:36:25
@@ -1913,11 +1913,21 @@ extern void rrotate_double	PARAMS ((unsi
 					 HOST_WIDE_INT *));
 
 /* In calls.c */
-extern void emit_library_call		PARAMS ((rtx, int, enum machine_mode,
-						  int, ...));
-extern rtx emit_library_call_value	PARAMS ((rtx, rtx, int,
-						 enum machine_mode,
-						 int, ...));
+enum libcall_type
+{
+  LCT_NORMAL = 0,
+  LCT_CONST = 1,
+  LCT_PURE = 2,
+  LCT_CONST_MAKE_BLOCK = 3,
+  LCT_PURE_MAKE_BLOCK = 4
+};
+
+extern void emit_library_call		PARAMS ((rtx, enum libcall_type,
+						 enum machine_mode, int,
+						 ...));
+extern rtx emit_library_call_value	PARAMS ((rtx, rtx, enum libcall_type,
+						 enum machine_mode, int,
+						 ...));
 
 /* In unroll.c */
 extern int set_dominates_use		PARAMS ((int, int, int, rtx, rtx));
Index: stmt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/stmt.c,v
retrieving revision 1.166
diff -u -p -r1.166 stmt.c
--- stmt.c	2000/09/10 21:34:38	1.166
+++ stmt.c	2000/09/16 19:36:27
@@ -713,7 +713,7 @@ expand_computed_goto (exp)
   emit_queue ();
   /* Be sure the function is executable.  */
   if (current_function_check_memory_usage)
-    emit_library_call (chkr_check_exec_libfunc, 1,
+    emit_library_call (chkr_check_exec_libfunc, LCT_CONST_MAKE_BLOCK,
 		       VOIDmode, 1, x, ptr_mode);
 
   do_pending_stack_adjust ();



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