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]

Remove mem checking code


As discussed.  tested on alphaev56-dec-osf4.0c.

Wed Dec  5 16:03:04 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* attribs.c (handle_no_check_memory_usage_atribute): Deleted.
	(c_com): Delete its reference.
	* builtins.c: Delete memory checking code.
	* calls.c, expr.c, function.c, stmt.c: Likewise.
	* builtins.c (expand_builtin_arg_info): Remove reference to
	EXPAND_MEMORY_USE_* modifiers.
	* explow.c (expr_size): Likewise.
	* expr.c (expand_expr, expand_increment): Likewise.
	* expr.h (ARGS_SIZE_RTX): Likewise.
	* function.c (assign_parms, expand_pending_sizeso): Likewise.
	* c-decl.c (duplicate_decls): Don't handle DECL_NO_CHECK_MEMORY_USAGE.
	* expr.c (in_check_memory_usage): Delete.
	(get_push_address, get_memory_usage_from_modifier): Delete.
	(expand_assigment): Use EXPAND_WRITE on destination.
	(expand_expr): Delete ro_modifier.
	* expr.h (expand_modifier): Delete EXPAND_MEMORY_* entries and
	add EXPAND_WRITE.
	(memory_use_mode): Delete.
	* flags.h (flag_check_memory_usage): Deleted.
	(flag_prefix_function_name): Likewise.
	* function.c (expand_function_start): Don't set
	current_function_check_memory_usage.
	* function.h (check_memory_usage): Delete.
	* libfuncs.h, optabs.c: Delete chkr_* stuff.
	* stmt.c (expand_asm_opernd): Change EXPAND_MEMORY_USE_WO to
	EXPAND_WRITE.
	* toplev.c (flag_check_memory_usage): Deleted.
	(flag_prefix_function_name): Likewise.
	(f_options, process_options): Delete references to above.
	* tree.h (DECL_NO_CHECK_MEMORY_USAGE): Deleted.
	* varasm.c (CHKR_PREFIX): Deleted.
	(make_decl_rtl): Remove flag_prefix_function_name handling.
	(assemble_name): Likewise.
	* doc/extend.texi: Remove no_check_memory_usage attribute.
	* doc/invoke.texi: Remove -fcheck-memory-usage
	and -fprefix-function-name.
	* cp/decl.c (duplicate_decls): Don't copy DECL_NO_CHECK_MEMORY_USAGE.

*** attribs.c	2001/11/04 02:51:21	1.4
--- attribs.c	2001/12/05 19:07:08
*************** static tree handle_no_instrument_functio
*** 77,82 ****
  							     tree, int,
  							     bool *));
- static tree handle_no_check_memory_usage_attribute PARAMS ((tree *, tree, tree,
- 							    int, bool *));
  static tree handle_malloc_attribute	PARAMS ((tree *, tree, tree, int,
  						 bool *));
--- 77,80 ----
*************** static const struct attribute_spec c_com
*** 132,137 ****
    { "no_instrument_function", 0, 0, true,  false, false,
  			      handle_no_instrument_function_attribute },
-   { "no_check_memory_usage",  0, 0, true,  false, false,
- 			      handle_no_check_memory_usage_attribute },
    { "malloc",                 0, 0, true,  false, false,
  			      handle_malloc_attribute },
--- 130,133 ----
*************** handle_no_instrument_function_attribute 
*** 1041,1077 ****
    else
      DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1;
- 
-   return NULL_TREE;
- }
- 
- /* Handle a "no_check_memory_usage" attribute; arguments as in
-    struct attribute_spec.handler.  */
- 
- static tree
- handle_no_check_memory_usage_attribute (node, name, args, flags, no_add_attrs)
-      tree *node;
-      tree name;
-      tree args ATTRIBUTE_UNUSED;
-      int flags ATTRIBUTE_UNUSED;
-      bool *no_add_attrs;
- {
-   tree decl = *node;
- 
-   if (TREE_CODE (decl) != FUNCTION_DECL)
-     {
-       error_with_decl (decl,
- 		       "`%s' attribute applies only to functions",
- 		       IDENTIFIER_POINTER (name));
-       *no_add_attrs = true;
-     }
-   else if (DECL_INITIAL (decl))
-     {
-       error_with_decl (decl,
- 		       "can't set `%s' attribute after definition",
- 		       IDENTIFIER_POINTER (name));
-       *no_add_attrs = true;
-     }
-   else
-     DECL_NO_CHECK_MEMORY_USAGE (decl) = 1;
  
    return NULL_TREE;
--- 1037,1040 ----
--- builtins.c	2001/12/05 19:07:16
*************** expand_builtin_strlen (exp, target)
*** 1618,1628 ****
        before_strlen = get_last_insn();
  
-       /* Check the string is readable and has an end.  */
-       if (current_function_check_memory_usage)
- 	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));
- 
        char_rtx = const0_rtx;
        char_mode = insn_data[(int) icode].operand[2].mode;
--- 1618,1621 ----
*************** expand_builtin_strstr (arglist, target, 
*** 1673,1678 ****
       enum machine_mode mode;
  {
!   if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)
!       || current_function_check_memory_usage)
      return 0;
    else
--- 1666,1670 ----
       enum machine_mode mode;
  {
!   if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
      return 0;
    else
*************** expand_builtin_strchr (arglist, target, 
*** 1730,1735 ****
       enum machine_mode mode;
  {
!   if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)
!       || current_function_check_memory_usage)
      return 0;
    else
--- 1722,1726 ----
       enum machine_mode mode;
  {
!   if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
      return 0;
    else
*************** expand_builtin_strrchr (arglist, target,
*** 1777,1782 ****
       enum machine_mode mode;
  {
!   if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)
!       || current_function_check_memory_usage)
      return 0;
    else
--- 1768,1772 ----
       enum machine_mode mode;
  {
!   if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
      return 0;
    else
*************** expand_builtin_strpbrk (arglist, target,
*** 1832,1837 ****
       enum machine_mode mode;
  {
!   if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)
!       || current_function_check_memory_usage)
      return 0;
    else
--- 1822,1826 ----
       enum machine_mode mode;
  {
!   if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
      return 0;
    else
*************** expand_builtin_memcpy (arglist)
*** 1940,1944 ****
  	 and only stored the computed constants.  */
        if (src_str
- 	  && !current_function_check_memory_usage
  	  && GET_CODE (len_rtx) == CONST_INT
  	  && (unsigned HOST_WIDE_INT) INTVAL (len_rtx) <= strlen (src_str) + 1
--- 1929,1932 ----
*************** expand_builtin_memcpy (arglist)
*** 1955,1965 ****
        set_mem_align (src_mem, src_align);
  
-       /* Just copy the rights of SRC to the rights of DEST.  */
-       if (current_function_check_memory_usage)
- 	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));
- 
        /* Copy word part most expediently.  */
        dest_addr = emit_block_move (dest_mem, src_mem, len_rtx);
--- 1943,1946 ----
*************** expand_builtin_memset (exp)
*** 2144,2151 ****
  	  if (!host_integerp (len, 1))
  	    return 0;
! 	  if (current_function_check_memory_usage
! 	      || !can_store_by_pieces (tree_low_cst (len, 1),
! 				       builtin_memset_read_str,
! 				       (PTR) &c, dest_align))
  	    return 0;
  
--- 2125,2131 ----
  	  if (!host_integerp (len, 1))
  	    return 0;
! 	  if (!can_store_by_pieces (tree_low_cst (len, 1),
! 				    builtin_memset_read_str, (PTR) &c,
! 				    dest_align))
  	    return 0;
  
*************** expand_builtin_memset (exp)
*** 2161,2174 ****
        dest_mem = get_memory_rtx (dest);
        set_mem_align (dest_mem, dest_align);
- 	   
-       /* Just check DST is writable and mark it as readable.  */
-       if (current_function_check_memory_usage)
- 	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));
- 
- 
        dest_addr = clear_storage (dest_mem, len_rtx);
  
--- 2141,2144 ----
*************** expand_builtin_memcmp (exp, arglist, tar
*** 2226,2233 ****
       rtx target;
  {
-   /* If we need to check memory accesses, call the library function.  */
-   if (current_function_check_memory_usage)
-     return 0;
- 
    if (!validate_arglist (arglist,
  		      POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
--- 2196,2199 ----
*************** expand_builtin_strcmp (exp, target, mode
*** 2310,2317 ****
    const char *p1, *p2;
  
-   /* If we need to check memory accesses, call the library function.  */
-   if (current_function_check_memory_usage)
-     return 0;
- 
    if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
      return 0;
--- 2276,2279 ----
*************** expand_builtin_strncmp (exp, target, mod
*** 2415,2422 ****
    const char *p1, *p2;
  
-   /* If we need to check memory accesses, call the library function.  */
-   if (current_function_check_memory_usage)
-     return 0;
- 
    if (!validate_arglist (arglist,
  			 POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
--- 2377,2380 ----
*************** expand_builtin_strcat (arglist, target, 
*** 2519,2526 ****
       enum machine_mode mode;
  {
-   /* If we need to check memory accesses, call the library function.  */
-   if (current_function_check_memory_usage)
-     return 0;
- 
    if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
      return 0;
--- 2477,2480 ----
*************** expand_builtin_strncat (arglist, target,
*** 2549,2556 ****
       enum machine_mode mode;
  {
-   /* If we need to check memory accesses, call the library function.  */
-   if (current_function_check_memory_usage)
-     return 0;
- 
    if (!validate_arglist (arglist,
  			 POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
--- 2503,2506 ----
*************** expand_builtin_strspn (arglist, target, 
*** 2606,2613 ****
       enum machine_mode mode;
  {
-   /* If we need to check memory accesses, call the library function.  */
-   if (current_function_check_memory_usage)
-     return 0;
- 
    if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
      return 0;
--- 2556,2559 ----
*************** expand_builtin_strcspn (arglist, target,
*** 2647,2654 ****
       enum machine_mode mode;
  {
-   /* If we need to check memory accesses, call the library function.  */
-   if (current_function_check_memory_usage)
-     return 0;
- 
    if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
      return 0;
--- 2593,2596 ----
*************** expand_builtin_args_info (exp)
*** 2792,2796 ****
    result = build1 (INDIRECT_REF, build_pointer_type (type), result);
    TREE_CONSTANT (result) = 1;
!   return expand_expr (result, NULL_RTX, VOIDmode, EXPAND_MEMORY_USE_BAD);
  #endif
  }
--- 2734,2738 ----
    result = build1 (INDIRECT_REF, build_pointer_type (type), result);
    TREE_CONSTANT (result) = 1;
!   return expand_expr (result, NULL_RTX, VOIDmode, 0);
  #endif
  }
*************** expand_builtin_fputs (arglist, ignore)
*** 3281,3286 ****
  
    /* Verify the arguments in the original call.  */
!   if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)
!       || current_function_check_memory_usage)
      return 0;
  
--- 3223,3227 ----
  
    /* Verify the arguments in the original call.  */
!   if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
      return 0;
  
*** c-decl.c	2001/12/04 22:55:37	1.278
--- c-decl.c	2001/12/05 19:07:45
*************** duplicate_decls (newdecl, olddecl, diffe
*** 1907,1917 ****
  	  DECL_STATIC_CONSTRUCTOR(newdecl) |= DECL_STATIC_CONSTRUCTOR(olddecl);
  	  DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl);
! 
  	  DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (newdecl)
  	    |= DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (olddecl);
- 	  DECL_NO_CHECK_MEMORY_USAGE (newdecl)
- 	    |= DECL_NO_CHECK_MEMORY_USAGE (olddecl);
- 	  DECL_NO_LIMIT_STACK (newdecl)
- 	    |= DECL_NO_LIMIT_STACK (olddecl);
  	}
      }
--- 1907,1913 ----
  	  DECL_STATIC_CONSTRUCTOR(newdecl) |= DECL_STATIC_CONSTRUCTOR(olddecl);
  	  DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl);
! 	  DECL_NO_LIMIT_STACK (newdecl) |= DECL_NO_LIMIT_STACK (olddecl);
  	  DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (newdecl)
  	    |= DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (olddecl);
  	}
      }
*** calls.c	2001/11/22 16:51:47	1.211
--- calls.c	2001/12/05 19:08:10
*************** rtx_for_function_call (fndecl, exp)
*** 1676,1690 ****
  	= expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
        pop_temp_slots ();	/* FUNEXP can't be BLKmode.  */
- 
-       /* Check the function is executable.  */
-       if (current_function_check_memory_usage)
- 	{
- #ifdef POINTERS_EXTEND_UNSIGNED
- 	  if (GET_MODE (funexp) != ptr_mode)
- 	    funaddr = convert_memory_address (ptr_mode, funexp);
- #endif
- 	  emit_library_call (chkr_check_exec_libfunc, LCT_CONST_MAKE_BLOCK,
- 			     VOIDmode, 1, funaddr, ptr_mode);
- 	}
        emit_queue ();
      }
--- 1676,1679 ----
*************** expand_call (exp, target, ignore)
*** 2163,2173 ****
    HOST_WIDE_INT preferred_unit_stack_boundary;
  
-   /* The value of the function call can be put in a hard register.  But
-      if -fcheck-memory-usage, code which invokes functions (and thus
-      damages some hard registers) can be inserted before using the value.
-      So, target is always a pseudo-register in that case.  */
-   if (current_function_check_memory_usage)
-     target = 0;
- 
    /* See if this is "nothrow" function call.  */
    if (TREE_NOTHROW (exp))
--- 2152,2155 ----
*************** expand_call (exp, target, ignore)
*** 3015,3028 ****
  						    NULL_RTX)));
  
- 	  /* Mark the memory for the aggregate as write-only.  */
- 	  if (current_function_check_memory_usage)
- 	    emit_library_call (chkr_set_right_libfunc, LCT_CONST_MAKE_BLOCK,
- 			       VOIDmode, 3,
- 			       structure_value_addr, ptr_mode,
- 			       GEN_INT (struct_value_size),
- 			       TYPE_MODE (sizetype),
- 			       GEN_INT (MEMORY_USE_WO),
- 			       TYPE_MODE (integer_type_node));
- 
  	  if (GET_CODE (struct_value_rtx) == REG)
  	    use_reg (&call_fusage, struct_value_rtx);
--- 2997,3000 ----
*************** store_one_arg (arg, argblock, flags, var
*** 4423,4438 ****
  
    if (arg->value == arg->stack)
!     {
!       /* 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, LCT_CONST_MAKE_BLOCK,
! 			     VOIDmode, 3, XEXP (arg->stack, 0), Pmode,
! 			     ARGS_SIZE_RTX (arg->size),
! 			     TYPE_MODE (sizetype),
! 			     GEN_INT (MEMORY_USE_RW),
! 			     TYPE_MODE (integer_type_node));
! 	}
!     }
    else if (arg->mode != BLKmode)
      {
--- 4395,4400 ----
  
    if (arg->value == arg->stack)
!     /* If the value is already in the stack slot, we are done.  */
!     ;
    else if (arg->mode != BLKmode)
      {
*** explow.c	2001/11/23 02:05:18	1.86
--- explow.c	2001/12/05 19:08:14
*************** expr_size (exp)
*** 298,303 ****
      size = build (WITH_RECORD_EXPR, sizetype, size, exp);
  
!   return expand_expr (size, NULL_RTX, TYPE_MODE (sizetype),
!   		      EXPAND_MEMORY_USE_BAD);
  }
  
--- 298,303 ----
      size = build (WITH_RECORD_EXPR, sizetype, size, exp);
  
!   return expand_expr (size, NULL_RTX, TYPE_MODE (sizetype), 0);
! 
  }
  
*** expr.c	2001/12/05 11:44:37	1.391
--- expr.c	2001/12/05 19:08:37
*************** Software Foundation, 59 Temple Place - S
*** 82,90 ****
  int cse_not_expected;
  
- /* Don't check memory usage, since code is being emitted to check a memory
-    usage.  Used when current_function_check_memory_usage is true, to avoid
-    infinite recursion.  */
- static int in_check_memory_usage;
- 
  /* Chain of pending expressions for PLACEHOLDER_EXPR to replace.  */
  static tree placeholder_list = 0;
--- 82,85 ----
*************** struct store_by_pieces
*** 125,130 ****
  extern struct obstack permanent_obstack;
  
- static rtx get_push_address	PARAMS ((int));
- 
  static rtx enqueue_insn		PARAMS ((rtx, rtx));
  static unsigned HOST_WIDE_INT move_by_pieces_ninsns
--- 120,123 ----
*************** static rtx store_field		PARAMS ((rtx, HO
*** 153,158 ****
  					 tree, enum machine_mode, int, tree,
  					 int));
- static enum memory_use_mode
-   get_memory_usage_from_modifier PARAMS ((enum expand_modifier));
  static rtx var_rtx		PARAMS ((tree));
  static HOST_WIDE_INT highest_pow2_factor PARAMS ((tree));
--- 146,149 ----
*************** push_block (size, extra, below)
*** 3125,3148 ****
  }
  
- 
- /* Return an rtx for the address of the beginning of an as-if-it-was-pushed
-    block of SIZE bytes.  */
- 
- static rtx
- get_push_address (size)
-      int size;
- {
-   rtx temp;
- 
-   if (STACK_PUSH_CODE == POST_DEC)
-     temp = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (size));
-   else if (STACK_PUSH_CODE == POST_INC)
-     temp = gen_rtx_MINUS (Pmode, stack_pointer_rtx, GEN_INT (size));
-   else
-     temp = stack_pointer_rtx;
- 
-   return copy_to_reg (temp);
- }
- 
  #ifdef PUSH_ROUNDING
  
--- 3116,3119 ----
*************** emit_push_insn (x, mode, type, size, ali
*** 3326,3351 ****
  
  	  move_by_pieces (NULL, xinner, INTVAL (size) - used, align);
- 
- 	  if (current_function_check_memory_usage && ! in_check_memory_usage)
- 	    {
- 	      rtx temp;
- 
- 	      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,
- 				   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,
- 				   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));
- 	      in_check_memory_usage = 0;
- 	    }
  	}
        else
--- 3297,3300 ----
*************** emit_push_insn (x, mode, type, size, ali
*** 3386,3409 ****
  								args_so_far),
  						  skip));
- 	  if (current_function_check_memory_usage && ! in_check_memory_usage)
- 	    {
- 	      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,
- 				   LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
- 				   target, Pmode,
- 				   XEXP (xinner, 0), Pmode,
- 				   size, TYPE_MODE (sizetype));
- 	      else
- 	        emit_library_call (chkr_set_right_libfunc,
- 				   LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
- 				   target, Pmode,
- 			 	   size, TYPE_MODE (sizetype),
- 				   GEN_INT (MEMORY_USE_RW),
- 				   TYPE_MODE (integer_type_node));
- 	      in_check_memory_usage = 0;
- 	    }
- 
  	  target = gen_rtx_MEM (BLKmode, temp);
  
--- 3335,3338 ----
*************** emit_push_insn (x, mode, type, size, ali
*** 3606,3630 ****
  	}
  
-       if (current_function_check_memory_usage && ! in_check_memory_usage)
- 	{
- 	  in_check_memory_usage = 1;
- 	  if (target == 0)
- 	    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,
- 			       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,
- 			       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));
- 	  in_check_memory_usage = 0;
- 	}
      }
  
--- 3535,3538 ----
*************** expand_assignment (to, from, want_value,
*** 3725,3730 ****
  	tem = stabilize_reference (tem);
  
!       orig_to_rtx = to_rtx
! 	= expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_MEMORY_USE_DONT);
        if (offset != 0)
  	{
--- 3633,3638 ----
  	tem = stabilize_reference (tem);
  
!       orig_to_rtx = to_rtx = expand_expr (tem, NULL_RTX, VOIDmode,
! 					  EXPAND_WRITE);
        if (offset != 0)
  	{
*************** expand_assignment (to, from, want_value,
*** 3813,3846 ****
  	}
  
-       /* Check the access.  */
-       if (current_function_check_memory_usage && GET_CODE (to_rtx) == MEM)
- 	{
- 	  rtx to_addr;
- 	  int size;
- 	  int best_mode_size;
- 	  enum machine_mode best_mode;
- 
- 	  best_mode = get_best_mode (bitsize, bitpos,
- 	  			     TYPE_ALIGN (TREE_TYPE (tem)),
- 	  			     mode1, volatilep);
- 	  if (best_mode == VOIDmode)
- 	    best_mode = QImode;
- 
- 	  best_mode_size = GET_MODE_BITSIZE (best_mode);
- 	  to_addr = plus_constant (XEXP (to_rtx, 0), bitpos / BITS_PER_UNIT);
- 	  size = CEIL ((bitpos % best_mode_size) + bitsize, best_mode_size);
- 	  size *= GET_MODE_SIZE (best_mode);
- 
- 	  /* Check the access right of the pointer.  */
- 	  in_check_memory_usage = 1;
- 	  if (size)
- 	    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));
- 	  in_check_memory_usage = 0;
- 	}
- 
        result = store_field (to_rtx, bitsize, bitpos, mode1, from,
  			    (want_value
--- 3721,3724 ----
*************** expand_assignment (to, from, want_value,
*** 3884,3888 ****
        value = expand_expr (from, NULL_RTX, VOIDmode, 0);
        if (to_rtx == 0)
! 	to_rtx = expand_expr (to, NULL_RTX, VOIDmode, EXPAND_MEMORY_USE_WO);
  
        /* Handle calls that return values in multiple non-contiguous locations.
--- 3762,3766 ----
        value = expand_expr (from, NULL_RTX, VOIDmode, 0);
        if (to_rtx == 0)
! 	to_rtx = expand_expr (to, NULL_RTX, VOIDmode, EXPAND_WRITE);
  
        /* Handle calls that return values in multiple non-contiguous locations.
*************** expand_assignment (to, from, want_value,
*** 3911,3915 ****
  
    if (to_rtx == 0)
!     to_rtx = expand_expr (to, NULL_RTX, VOIDmode, EXPAND_MEMORY_USE_WO);
  
    /* Don't move directly into a return register.  */
--- 3789,3793 ----
  
    if (to_rtx == 0)
!     to_rtx = expand_expr (to, NULL_RTX, VOIDmode, EXPAND_WRITE);
  
    /* Don't move directly into a return register.  */
*************** expand_assignment (to, from, want_value,
*** 3944,3958 ****
        push_temp_slots ();
        size = expr_size (from);
!       from_rtx = expand_expr (from, NULL_RTX, VOIDmode,
! 			      EXPAND_MEMORY_USE_DONT);
! 
!       /* Copy the rights of the bitmap.  */
!       if (current_function_check_memory_usage)
! 	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
--- 3822,3826 ----
        push_temp_slots ();
        size = expr_size (from);
!       from_rtx = expand_expr (from, NULL_RTX, VOIDmode, 0);
  
  #ifdef TARGET_MEM_FUNCTIONS
*************** store_expr (exp, target, want_value)
*** 4196,4221 ****
  			  temp, TREE_UNSIGNED (TREE_TYPE (exp)));
  
-   if (current_function_check_memory_usage
-       && GET_CODE (target) == MEM
-       && AGGREGATE_TYPE_P (TREE_TYPE (exp)))
-     {
-       in_check_memory_usage = 1;
-       if (GET_CODE (temp) == MEM)
- 	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, 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));
-       in_check_memory_usage = 0;
-     }
- 
    /* If value was not generated in the target, store it there.
!      Convert the value to TARGET's type first if nec.  */
!   /* If TEMP and TARGET compare equal according to rtx_equal_p, but
       one or both of them are volatile memory refs, we have to distinguish
       two cases:
--- 4064,4070 ----
  			  temp, TREE_UNSIGNED (TREE_TYPE (exp)));
  
    /* If value was not generated in the target, store it there.
!      Convert the value to TARGET's type first if necessary.
!      If TEMP and TARGET compare equal according to rtx_equal_p, but
       one or both of them are volatile memory refs, we have to distinguish
       two cases:
*************** store_expr (exp, target, want_value)
*** 4306,4322 ****
  
  	      if (size != const0_rtx)
! 		{
! 		  /* 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,
! 				       LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
! 				       XEXP (target, 0), Pmode,
! 				       size, TYPE_MODE (sizetype),
!  				       GEN_INT (MEMORY_USE_WO),
! 				       TYPE_MODE (integer_type_node));
! 		  in_check_memory_usage = 0;
! 		  clear_storage (target, size);
! 		}
  
  	      if (label)
--- 4155,4159 ----
  
  	      if (size != const0_rtx)
! 		clear_storage (target, size);
  
  	      if (label)
*************** handled_component_p (t)
*** 5509,5543 ****
      }
  }
- 
- /* Subroutine of expand_exp: compute memory_usage from modifier.  */
- 
- static enum memory_use_mode
- get_memory_usage_from_modifier (modifier)
-      enum expand_modifier modifier;
- {
-   switch (modifier)
-     {
-     case EXPAND_NORMAL:
-     case EXPAND_SUM:
-       return MEMORY_USE_RO;
-       break;
-     case EXPAND_MEMORY_USE_WO:
-       return MEMORY_USE_WO;
-       break;
-     case EXPAND_MEMORY_USE_RW:
-       return MEMORY_USE_RW;
-       break;
-     case EXPAND_MEMORY_USE_DONT:
-       /* EXPAND_CONST_ADDRESS and EXPAND_INITIALIZER are converted into
- 	 MEMORY_USE_DONT, because they are modifiers to a call of
- 	 expand_expr in the ADDR_EXPR case of expand_expr.  */
-     case EXPAND_CONST_ADDRESS:
-     case EXPAND_INITIALIZER:
-       return MEMORY_USE_DONT;
-     case EXPAND_MEMORY_USE_BAD:
-     default:
-       abort ();
-     }
- }
  
  /* Given an rtx VALUE that may contain additions and multiplications, return
--- 5346,5349 ----
*************** expand_expr (exp, target, tmode, modifie
*** 6134,6139 ****
    int ignore;
    tree context;
-   /* Used by check-memory-usage to make modifier read only.  */
-   enum expand_modifier ro_modifier;
  
    /* Handle ERROR_MARK before anybody tries to access its type.  */
--- 5940,5943 ----
*************** expand_expr (exp, target, tmode, modifie
*** 6156,6166 ****
  		&& TREE_CODE (type) == VOID_TYPE));
  
-   /* Make a read-only version of the modifier.  */
-   if (modifier == EXPAND_NORMAL || modifier == EXPAND_SUM
-       || modifier == EXPAND_CONST_ADDRESS || modifier == EXPAND_INITIALIZER)
-     ro_modifier = modifier;
-   else
-     ro_modifier = EXPAND_NORMAL;
- 
    /* If we are going to ignore this result, we need only do something
       if there is a side-effect somewhere in the expression.  If there
--- 5960,5963 ----
*************** expand_expr (exp, target, tmode, modifie
*** 6181,6185 ****
  	  && modifier != EXPAND_CONST_ADDRESS)
  	{
! 	  temp = expand_expr (exp, NULL_RTX, VOIDmode, ro_modifier);
  	  if (GET_CODE (temp) == MEM)
  	    temp = copy_to_reg (temp);
--- 5978,5982 ----
  	  && modifier != EXPAND_CONST_ADDRESS)
  	{
! 	  temp = expand_expr (exp, NULL_RTX, VOIDmode, modifier);
  	  if (GET_CODE (temp) == MEM)
  	    temp = copy_to_reg (temp);
*************** expand_expr (exp, target, tmode, modifie
*** 6189,6201 ****
        if (TREE_CODE_CLASS (code) == '1' || code == COMPONENT_REF
  	  || code == INDIRECT_REF || code == BUFFER_REF)
! 	return expand_expr (TREE_OPERAND (exp, 0), const0_rtx,
! 			    VOIDmode, ro_modifier);
        else if (TREE_CODE_CLASS (code) == '2' || TREE_CODE_CLASS (code) == '<'
  	       || code == ARRAY_REF || code == ARRAY_RANGE_REF)
  	{
! 	  expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode,
! 		       ro_modifier);
! 	  expand_expr (TREE_OPERAND (exp, 1), const0_rtx, VOIDmode,
! 		       ro_modifier);
  	  return const0_rtx;
  	}
--- 5986,5997 ----
        if (TREE_CODE_CLASS (code) == '1' || code == COMPONENT_REF
  	  || code == INDIRECT_REF || code == BUFFER_REF)
! 	return expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode,
! 			    modifier);
! 
        else if (TREE_CODE_CLASS (code) == '2' || TREE_CODE_CLASS (code) == '<'
  	       || code == ARRAY_REF || code == ARRAY_RANGE_REF)
  	{
! 	  expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, modifier);
! 	  expand_expr (TREE_OPERAND (exp, 1), const0_rtx, VOIDmode, modifier);
  	  return const0_rtx;
  	}
*************** expand_expr (exp, target, tmode, modifie
*** 6204,6220 ****
  	/* If the second operand has no side effects, just evaluate
  	   the first.  */
! 	return expand_expr (TREE_OPERAND (exp, 0), const0_rtx,
! 			    VOIDmode, ro_modifier);
        else if (code == BIT_FIELD_REF)
  	{
! 	  expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode,
! 		       ro_modifier);
! 	  expand_expr (TREE_OPERAND (exp, 1), const0_rtx, VOIDmode,
! 		       ro_modifier);
! 	  expand_expr (TREE_OPERAND (exp, 2), const0_rtx, VOIDmode,
! 		       ro_modifier);
  	  return const0_rtx;
  	}
!       ;
        target = 0;
      }
--- 6000,6013 ----
  	/* If the second operand has no side effects, just evaluate
  	   the first.  */
! 	return expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode,
! 			    modifier);
        else if (code == BIT_FIELD_REF)
  	{
! 	  expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, modifier);
! 	  expand_expr (TREE_OPERAND (exp, 1), const0_rtx, VOIDmode, modifier);
! 	  expand_expr (TREE_OPERAND (exp, 2), const0_rtx, VOIDmode, modifier);
  	  return const0_rtx;
  	}
! 
        target = 0;
      }
*************** expand_expr (exp, target, tmode, modifie
*** 6332,6364 ****
  	      SET_DECL_RTL (exp, value);
  	    }
! 	}
! 
!       /* Although static-storage variables start off initialized, according to
! 	 ANSI C, a memcpy could overwrite them with uninitialized values.  So
! 	 we check them too.  This also lets us check for read-only variables
! 	 accessed via a non-const declaration, in case it won't be detected
! 	 any other way (e.g., in an embedded system or OS kernel without
! 	 memory protection).
! 
! 	 Aggregates are not checked here; they're handled elsewhere.  */
!       if (cfun && current_function_check_memory_usage
! 	  && code == VAR_DECL
! 	  && GET_CODE (DECL_RTL (exp)) == MEM
! 	  && ! AGGREGATE_TYPE_P (TREE_TYPE (exp)))
! 	{
! 	  enum memory_use_mode memory_usage;
! 	  memory_usage = get_memory_usage_from_modifier (modifier);
! 
! 	  in_check_memory_usage = 1;
! 	  if (memory_usage != MEMORY_USE_DONT)
! 	    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),
! 			       GEN_INT (memory_usage),
! 			       TYPE_MODE (integer_type_node));
! 	  in_check_memory_usage = 0;
! 	}
  
        /* ... fall through ...  */
--- 6125,6129 ----
  	      SET_DECL_RTL (exp, value);
  	    }
! 	  }
  
        /* ... fall through ...  */
*************** expand_expr (exp, target, tmode, modifie
*** 6474,6479 ****
  
      case CONST_DECL:
!       return expand_expr (DECL_INITIAL (exp), target, VOIDmode,
! 			  EXPAND_MEMORY_USE_BAD);
  
      case REAL_CST:
--- 6239,6243 ----
  
      case CONST_DECL:
!       return expand_expr (DECL_INITIAL (exp), target, VOIDmode, 0);
  
      case REAL_CST:
*************** expand_expr (exp, target, tmode, modifie
*** 6588,6593 ****
  
  	  if (temp == const0_rtx)
! 	    expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode,
! 			 EXPAND_MEMORY_USE_BAD);
  	  else
  	    store_expr (TREE_OPERAND (exp, 0), temp, 0);
--- 6352,6356 ----
  
  	  if (temp == const0_rtx)
! 	    expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, 0);
  	  else
  	    store_expr (TREE_OPERAND (exp, 0), temp, 0);
*************** expand_expr (exp, target, tmode, modifie
*** 6631,6635 ****
  
  	placeholder_list = TREE_CHAIN (placeholder_expr);
! 	temp = expand_expr (exp, original_target, tmode, ro_modifier);
  	placeholder_list = old_list;
  	return temp;
--- 6394,6398 ----
  
  	placeholder_list = TREE_CHAIN (placeholder_expr);
! 	temp = expand_expr (exp, original_target, tmode, modifier);
  	placeholder_list = old_list;
  	return temp;
*************** expand_expr (exp, target, tmode, modifie
*** 6644,6649 ****
        placeholder_list = tree_cons (TREE_OPERAND (exp, 1), NULL_TREE,
  				    placeholder_list);
!       target = expand_expr (TREE_OPERAND (exp, 0), original_target,
! 			    tmode, ro_modifier);
        placeholder_list = TREE_CHAIN (placeholder_list);
        return target;
--- 6407,6412 ----
        placeholder_list = tree_cons (TREE_OPERAND (exp, 1), NULL_TREE,
  				    placeholder_list);
!       target = expand_expr (TREE_OPERAND (exp, 0), original_target, tmode,
! 			    modifier);
        placeholder_list = TREE_CHAIN (placeholder_list);
        return target;
*************** expand_expr (exp, target, tmode, modifie
*** 6710,6714 ****
  	  }
  
! 	temp = expand_expr (TREE_OPERAND (exp, 1), target, tmode, ro_modifier);
  
  	expand_end_bindings (TREE_OPERAND (exp, 0), 0, 0);
--- 6473,6477 ----
  	  }
  
! 	temp = expand_expr (TREE_OPERAND (exp, 1), target, tmode, modifier);
  
  	expand_end_bindings (TREE_OPERAND (exp, 0), 0, 0);
*************** expand_expr (exp, target, tmode, modifie
*** 6735,6741 ****
  	{
  	  tree elt;
  	  for (elt = CONSTRUCTOR_ELTS (exp); elt; elt = TREE_CHAIN (elt))
! 	    expand_expr (TREE_VALUE (elt), const0_rtx, VOIDmode,
! 	    		 EXPAND_MEMORY_USE_BAD);
  	  return const0_rtx;
  	}
--- 6498,6505 ----
  	{
  	  tree elt;
+ 
  	  for (elt = CONSTRUCTOR_ELTS (exp); elt; elt = TREE_CHAIN (elt))
! 	    expand_expr (TREE_VALUE (elt), const0_rtx, VOIDmode, 0);
! 
  	  return const0_rtx;
  	}
*************** expand_expr (exp, target, tmode, modifie
*** 6799,6803 ****
   	    && GET_MODE_CLASS (mode) == MODE_INT
   	    && GET_MODE_SIZE (mode) == 1
! 	    && modifier != EXPAND_MEMORY_USE_WO)
   	  return
  	    GEN_INT (TREE_STRING_POINTER (string)[TREE_INT_CST_LOW (index)]);
--- 6563,6567 ----
   	    && GET_MODE_CLASS (mode) == MODE_INT
   	    && GET_MODE_SIZE (mode) == 1
! 	    && modifier != EXPAND_WRITE)
   	  return
  	    GEN_INT (TREE_STRING_POINTER (string)[TREE_INT_CST_LOW (index)]);
*************** expand_expr (exp, target, tmode, modifie
*** 6805,6828 ****
  	op0 = expand_expr (exp1, NULL_RTX, VOIDmode, EXPAND_SUM);
  	op0 = memory_address (mode, op0);
- 
- 	if (cfun && current_function_check_memory_usage
- 	    && ! AGGREGATE_TYPE_P (TREE_TYPE (exp)))
- 	  {
- 	    enum memory_use_mode memory_usage;
- 	    memory_usage = get_memory_usage_from_modifier (modifier);
- 
-             if (memory_usage != MEMORY_USE_DONT)
- 	      {
- 		in_check_memory_usage = 1;
- 		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));
- 		in_check_memory_usage = 0;
- 	      }
- 	  }
- 
  	temp = gen_rtx_MEM (mode, op0);
  	set_mem_attributes (temp, exp, 0);
--- 6569,6572 ----
*************** expand_expr (exp, target, tmode, modifie
*** 6831,6835 ****
  	   readonly fields, we must mark it as readonly so it will
  	   conflict with readonly references to those fields.  */
! 	if (modifier == EXPAND_MEMORY_USE_WO && readonly_fields_p (type))
  	  RTX_UNCHANGING_P (temp) = 1;
  
--- 6575,6579 ----
  	   readonly fields, we must mark it as readonly so it will
  	   conflict with readonly references to those fields.  */
! 	if (modifier == EXPAND_WRITE && readonly_fields_p (type))
  	  RTX_UNCHANGING_P (temp) = 1;
  
*************** expand_expr (exp, target, tmode, modifie
*** 6893,6898 ****
  
  	    if (elem)
! 	      return expand_expr (fold (TREE_VALUE (elem)), target,
! 				  tmode, ro_modifier);
  	  }
  
--- 6637,6642 ----
  
  	    if (elem)
! 	      return expand_expr (fold (TREE_VALUE (elem)), target, tmode,
! 				  modifier);
  	  }
  
*************** expand_expr (exp, target, tmode, modifie
*** 6920,6924 ****
  		    if (elem && !TREE_SIDE_EFFECTS (TREE_VALUE (elem)))
  		      return expand_expr (fold (TREE_VALUE (elem)), target,
! 					  tmode, ro_modifier);
  		  }
  		else if (TREE_CODE (init) == STRING_CST
--- 6664,6668 ----
  		    if (elem && !TREE_SIDE_EFFECTS (TREE_VALUE (elem)))
  		      return expand_expr (fold (TREE_VALUE (elem)), target,
! 					  tmode, modifier);
  		  }
  		else if (TREE_CODE (init) == STRING_CST
*************** expand_expr (exp, target, tmode, modifie
*** 7118,7149 ****
  	  }
  
- 	/* Check the access.  */
- 	if (cfun != 0 && current_function_check_memory_usage
- 	    && GET_CODE (op0) == MEM)
- 	  {
- 	    enum memory_use_mode memory_usage;
- 	    memory_usage = get_memory_usage_from_modifier (modifier);
- 
- 	    if (memory_usage != MEMORY_USE_DONT)
- 	      {
- 		rtx to;
- 		int size;
- 
- 		to = plus_constant (XEXP (op0, 0), (bitpos / BITS_PER_UNIT));
- 		size = (bitpos % BITS_PER_UNIT) + bitsize + BITS_PER_UNIT - 1;
- 
-         	/* Check the access right of the pointer.  */
- 		in_check_memory_usage = 1;
- 		if (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));
- 		in_check_memory_usage = 0;
- 	      }
- 	  }
- 
  	/* In cases where an aligned union has an unaligned object
  	   as a field, we might be extracting a BLKmode value from
--- 6862,6865 ----
*************** expand_expr (exp, target, tmode, modifie
*** 7417,7421 ****
  	{
  	  WITH_CLEANUP_EXPR_RTL (exp)
! 	    = expand_expr (TREE_OPERAND (exp, 0), target, tmode, ro_modifier);
  	  expand_decl_cleanup (NULL_TREE, TREE_OPERAND (exp, 1));
  
--- 7133,7137 ----
  	{
  	  WITH_CLEANUP_EXPR_RTL (exp)
! 	    = expand_expr (TREE_OPERAND (exp, 0), target, tmode, modifier);
  	  expand_decl_cleanup (NULL_TREE, TREE_OPERAND (exp, 1));
  
*************** expand_expr (exp, target, tmode, modifie
*** 7433,7437 ****
  	target_temp_slot_level = temp_slot_level;
  
! 	op0 = expand_expr (TREE_OPERAND (exp, 0), target, tmode, ro_modifier);
  	/* If we're going to use this value, load it up now.  */
  	if (! ignore)
--- 7149,7153 ----
  	target_temp_slot_level = temp_slot_level;
  
! 	op0 = expand_expr (TREE_OPERAND (exp, 0), target, tmode, modifier);
  	/* If we're going to use this value, load it up now.  */
  	if (! ignore)
*************** expand_expr (exp, target, tmode, modifie
*** 7508,7512 ****
  	{
  	  op0 = expand_expr (TREE_OPERAND (exp, 0), target, VOIDmode,
! 			     ro_modifier);
  
  	  /* If the signedness of the conversion differs and OP0 is
--- 7224,7228 ----
  	{
  	  op0 = expand_expr (TREE_OPERAND (exp, 0), target, VOIDmode,
! 			     modifier);
  
  	  /* If the signedness of the conversion differs and OP0 is
*************** expand_expr (exp, target, tmode, modifie
*** 7543,7547 ****
  
      case VIEW_CONVERT_EXPR:
!       op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, ro_modifier);
  
        /* If the input and output modes are both the same, we are done.
--- 7259,7263 ----
  
      case VIEW_CONVERT_EXPR:
!       op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, modifier);
  
        /* If the input and output modes are both the same, we are done.
*************** expand_expr (exp, target, tmode, modifie
*** 7723,7728 ****
  	subtarget = 0;
  
!       op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, ro_modifier);
!       op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, ro_modifier);
  
      both_summands:
--- 7439,7444 ----
  	subtarget = 0;
  
!       op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, modifier);
!       op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, modifier);
  
      both_summands:
*************** expand_expr (exp, target, tmode, modifie
*** 7783,7790 ****
  	  && really_constant_p (TREE_OPERAND (exp, 1)))
  	{
! 	  rtx op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX,
! 				 VOIDmode, ro_modifier);
! 	  rtx op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX,
! 				 VOIDmode, ro_modifier);
  
  	  /* If the last operand is a CONST_INT, use plus_constant of
--- 7499,7506 ----
  	  && really_constant_p (TREE_OPERAND (exp, 1)))
  	{
! 	  rtx op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode,
! 				 modifier);
! 	  rtx op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode,
! 				 modifier);
  
  	  /* If the last operand is a CONST_INT, use plus_constant of
*************** expand_expr (exp, target, tmode, modifie
*** 8268,8276 ****
  	      {
  		expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode,
! 			     ro_modifier);
  		return const0_rtx;
  	      }
  
! 	    op0 = expand_expr (TREE_OPERAND (exp, 0), target, mode, ro_modifier);
  	    if (GET_MODE (op0) == mode)
  	      return op0;
--- 7984,7992 ----
  	      {
  		expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode,
! 			     modifier);
  		return const0_rtx;
  	      }
  
! 	    op0 = expand_expr (TREE_OPERAND (exp, 0), target, mode, modifier);
  	    if (GET_MODE (op0) == mode)
  	      return op0;
*************** expand_increment (exp, post, ignore)
*** 9077,9081 ****
  
    temp = get_last_insn ();
!   op0 = expand_expr (incremented, NULL_RTX, VOIDmode, EXPAND_MEMORY_USE_RW);
  
    /* If OP0 is a SUBREG made for a promoted variable, we cannot increment
--- 8793,8797 ----
  
    temp = get_last_insn ();
!   op0 = expand_expr (incremented, NULL_RTX, VOIDmode, 0);
  
    /* If OP0 is a SUBREG made for a promoted variable, we cannot increment
*************** expand_increment (exp, post, ignore)
*** 9108,9113 ****
    op0_is_copy = ((GET_CODE (op0) == SUBREG || GET_CODE (op0) == REG)
  		 && temp != get_last_insn ());
!   op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode,
! 		     EXPAND_MEMORY_USE_BAD);
  
    /* Decide whether incrementing or decrementing.  */
--- 8824,8828 ----
    op0_is_copy = ((GET_CODE (op0) == SUBREG || GET_CODE (op0) == REG)
  		 && temp != get_last_insn ());
!   op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
  
    /* Decide whether incrementing or decrementing.  */
*************** expand_increment (exp, post, ignore)
*** 9230,9236 ****
  
    /* Increment however we can.  */
!   op1 = expand_binop (mode, this_optab, value, op1,
! 		      current_function_check_memory_usage ? NULL_RTX : op0,
  		      TREE_UNSIGNED (TREE_TYPE (exp)), OPTAB_LIB_WIDEN);
    /* Make sure the value is stored into OP0.  */
    if (op1 != op0)
--- 8945,8951 ----
  
    /* Increment however we can.  */
!   op1 = expand_binop (mode, this_optab, value, op1, op0,
  		      TREE_UNSIGNED (TREE_TYPE (exp)), OPTAB_LIB_WIDEN);
+ 
    /* Make sure the value is stored into OP0.  */
    if (op1 != op0)
*** expr.h	2001/12/02 19:04:22	1.106
--- expr.h	2001/12/05 19:08:39
*************** Software Foundation, 59 Temple Place - S
*** 49,72 ****
     EXPAND_CONST_ADDRESS means it is ok to return a MEM whose address
      is a constant that is not a legitimate address.
!    EXPAND_MEMORY_USE_* are explained below.  */
! enum expand_modifier {EXPAND_NORMAL, EXPAND_SUM,
! 		      EXPAND_CONST_ADDRESS, EXPAND_INITIALIZER,
! 		      EXPAND_MEMORY_USE_WO, EXPAND_MEMORY_USE_RW,
! 		      EXPAND_MEMORY_USE_BAD, EXPAND_MEMORY_USE_DONT};
! 
! /* Argument for chkr_* functions.
!    MEMORY_USE_RO: the pointer reads memory.
!    MEMORY_USE_WO: the pointer writes to memory.
!    MEMORY_USE_RW: the pointer modifies memory (ie it reads and writes). An
!                   example is (*ptr)++
!    MEMORY_USE_BAD: use this if you don't know the behavior of the pointer, or
!                    if you know there are no pointers.  Using an INDIRECT_REF
!                    with MEMORY_USE_BAD will abort.
!    MEMORY_USE_TW: just test for writing, without update.  Special.
!    MEMORY_USE_DONT: the memory is neither read nor written.  This is used by
!    		   '->' and '.'.  */
! enum memory_use_mode {MEMORY_USE_BAD = 0, MEMORY_USE_RO = 1,
! 		      MEMORY_USE_WO = 2, MEMORY_USE_RW = 3,
! 		      MEMORY_USE_TW = 6, MEMORY_USE_DONT = 99};
  
  /* Prevent the compiler from deferring stack pops.  See
--- 49,55 ----
     EXPAND_CONST_ADDRESS means it is ok to return a MEM whose address
      is a constant that is not a legitimate address.
!    EXPAND_WRITE means we are only going to write to the resulting rtx.  */
! enum expand_modifier {EXPAND_NORMAL, EXPAND_SUM, EXPAND_CONST_ADDRESS,
! 			EXPAND_INITIALIZER, EXPAND_WRITE};
  
  /* Prevent the compiler from deferring stack pops.  See
*************** struct args_size
*** 120,125 ****
  #define ARGS_SIZE_RTX(SIZE)					\
  ((SIZE).var == 0 ? GEN_INT ((SIZE).constant)			\
!  : expand_expr (ARGS_SIZE_TREE (SIZE), NULL_RTX, VOIDmode,	\
! 		EXPAND_MEMORY_USE_BAD))
  
  /* Supply a default definition for FUNCTION_ARG_PADDING:
--- 103,107 ----
  #define ARGS_SIZE_RTX(SIZE)					\
  ((SIZE).var == 0 ? GEN_INT ((SIZE).constant)			\
!  : expand_expr (ARGS_SIZE_TREE (SIZE), NULL_RTX, VOIDmode, 0))
  
  /* Supply a default definition for FUNCTION_ARG_PADDING:
*** flags.h	2001/12/02 14:38:07	1.71
--- flags.h	2001/12/05 19:08:41
*************** extern int flag_renumber_insns;
*** 570,585 ****
  extern int frame_pointer_needed;
  
- /* Nonzero if GCC must add code to check memory access (used by Checker).  */
- 
- extern int flag_check_memory_usage;
- 
  /* Nonzero if the generated code should trap on signed overflow
     for PLUS / SUB / MULT.  */
  extern int flag_trapv;
- 
- /* Nonzero if GCC must prefix function names (used with
-    flag_check_memory_usage).  */
- 
- extern int flag_prefix_function_name;
  
  /* Value of the -G xx switch, and whether it was passed or not.  */
--- 570,576 ----
*** function.c	2001/12/05 11:49:24	1.331
--- function.c	2001/12/05 19:08:55
*************** put_var_into_stack (decl)
*** 1433,1444 ****
    else
      return;
- 
-   if (current_function_check_memory_usage)
-     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),
- 		       TYPE_MODE (integer_type_node));
  }
  
--- 1433,1436 ----
*************** assign_parms (fndecl)
*** 4825,4836 ****
  	      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,
- 				   LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
- 				   XEXP (copy, 0), Pmode,
- 				   GEN_INT (int_size_in_bytes (type)),
- 				   TYPE_MODE (sizetype),
- 				   GEN_INT (MEMORY_USE_RW),
- 				   TYPE_MODE (integer_type_node));
  	      conversion_insns = get_insns ();
  	      did_conversion = 1;
--- 4817,4820 ----
*************** assign_parms (fndecl)
*** 5001,5018 ****
  				validize_mem (entry_parm));
  	    }
- 	  if (current_function_check_memory_usage)
- 	    {
- 	      push_to_sequence (conversion_insns);
- 	      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),
- 				 GEN_INT (MEMORY_USE_RW),
- 				 TYPE_MODE (integer_type_node));
  
- 	      conversion_insns = get_insns ();
- 	      end_sequence ();
- 	    }
  	  SET_DECL_RTL (parm, stack_parm);
  	}
--- 4985,4989 ----
*************** assign_parms (fndecl)
*** 5075,5079 ****
         : expand_expr (size_diffop (stack_args_size.var,
  				   size_int (-stack_args_size.constant)),
! 		      NULL_RTX, VOIDmode, EXPAND_MEMORY_USE_BAD));
  #else
    current_function_arg_offset_rtx = ARGS_SIZE_RTX (stack_args_size);
--- 5046,5050 ----
         : expand_expr (size_diffop (stack_args_size.var,
  				   size_int (-stack_args_size.constant)),
! 		      NULL_RTX, VOIDmode, 0);
  #else
    current_function_arg_offset_rtx = ARGS_SIZE_RTX (stack_args_size);
*************** expand_pending_sizes (pending_sizes)
*** 6353,6358 ****
    for (tem = pending_sizes; tem; tem = TREE_CHAIN (tem))
      {
!       expand_expr (TREE_VALUE (tem), const0_rtx, VOIDmode,
! 		   EXPAND_MEMORY_USE_BAD);
        /* Flush the queue in case this parameter declaration has
  	 side-effects.  */
--- 6324,6328 ----
    for (tem = pending_sizes; tem; tem = TREE_CHAIN (tem))
      {
!       expand_expr (TREE_VALUE (tem), const0_rtx, VOIDmode, 0);
        /* Flush the queue in case this parameter declaration has
  	 side-effects.  */
*************** expand_function_start (subr, parms_have_
*** 6378,6386 ****
       valid operands of arithmetic insns.  */
    init_recog_no_volatile ();
- 
-   /* Set this before generating any memory accesses.  */
-   current_function_check_memory_usage
-     = (flag_check_memory_usage
-        && ! DECL_NO_CHECK_MEMORY_USAGE (current_function_decl));
  
    current_function_instrument_entry_exit
--- 6348,6351 ----
*** function.h	2001/12/05 11:52:49	1.72
--- function.h	2001/12/05 19:08:56
*************** struct function
*** 435,441 ****
    unsigned int instrument_entry_exit : 1;
  
-   /* Nonzero if memory access checking be enabled in the current function.  */
-   unsigned int check_memory_usage : 1;
- 
    /* Nonzero if stack limit checking should be enabled in the current
       function.  */
--- 435,438 ----
*************** extern int virtuals_instantiated;
*** 508,512 ****
  #define current_function_return_rtx (cfun->return_rtx)
  #define current_function_instrument_entry_exit (cfun->instrument_entry_exit)
- #define current_function_check_memory_usage (cfun->check_memory_usage)
  #define current_function_limit_stack (cfun->limit_stack)
  #define current_function_uses_pic_offset_table (cfun->uses_pic_offset_table)
--- 505,508 ----
*** libfuncs.h	2001/08/23 10:21:42	1.2
--- libfuncs.h	2001/12/05 19:08:58
*************** enum libfunc_index
*** 140,149 ****
    LTI_fixunstfti,
  
-   LTI_chkr_check_addr,
-   LTI_chkr_set_right,
-   LTI_chkr_copy_bitmap,
-   LTI_chkr_check_exec,
-   LTI_chkr_check_str,
- 
    LTI_profile_function_entry,
    LTI_profile_function_exit,
--- 140,143 ----
*************** extern rtx libfunc_table[LTI_MAX];
*** 272,281 ****
  #define fixunstfdi_libfunc	(libfunc_table[LTI_fixunstfdi])
  #define fixunstfti_libfunc	(libfunc_table[LTI_fixunstfti])
- 
- #define chkr_check_addr_libfunc	(libfunc_table[LTI_chkr_check_addr])
- #define chkr_set_right_libfunc	(libfunc_table[LTI_chkr_set_right])
- #define chkr_copy_bitmap_libfunc	(libfunc_table[LTI_chkr_copy_bitmap])
- #define chkr_check_exec_libfunc	(libfunc_table[LTI_chkr_check_exec])
- #define chkr_check_str_libfunc	(libfunc_table[LTI_chkr_check_str])
  
  #define profile_function_entry_libfunc	(libfunc_table[LTI_profile_function_entry])
--- 266,269 ----
*** optabs.c	2001/11/21 11:13:14	1.119
--- optabs.c	2001/12/05 19:09:10
*************** init_optabs ()
*** 5051,5061 ****
    fixunstfti_libfunc = init_one_libfunc ("__fixunstfti");
  
-   /* For check-memory-usage.  */
-   chkr_check_addr_libfunc = init_one_libfunc ("chkr_check_addr");
-   chkr_set_right_libfunc = init_one_libfunc ("chkr_set_right");
-   chkr_copy_bitmap_libfunc = init_one_libfunc ("chkr_copy_bitmap");
-   chkr_check_exec_libfunc = init_one_libfunc ("chkr_check_exec");
-   chkr_check_str_libfunc = init_one_libfunc ("chkr_check_str");
- 
    /* For function entry/exit instrumentation.  */
    profile_function_entry_libfunc
--- 5051,5054 ----
*** stmt.c	2001/12/04 17:37:23	1.235
--- stmt.c	2001/12/05 19:09:24
*************** expand_computed_goto (exp)
*** 713,721 ****
  
    emit_queue ();
-   /* Be sure the function is executable.  */
-   if (current_function_check_memory_usage)
-     emit_library_call (chkr_check_exec_libfunc, LCT_CONST_MAKE_BLOCK,
- 		       VOIDmode, 1, x, ptr_mode);
- 
    do_pending_stack_adjust ();
    emit_indirect_jump (x);
--- 713,716 ----
*************** expand_asm (body)
*** 1291,1300 ****
       tree body;
  {
-   if (current_function_check_memory_usage)
-     {
-       error ("`asm' cannot be used in function where memory usage is checked");
-       return;
-     }
- 
    if (TREE_CODE (body) == ADDR_EXPR)
      body = TREE_OPERAND (body, 0);
--- 1286,1289 ----
*************** expand_asm_operands (string, outputs, in
*** 1504,1513 ****
      vol = 1;
  
-   if (current_function_check_memory_usage)
-     {
-       error ("`asm' cannot be used in function where memory usage is checked");
-       return;
-     }
- 
    if (! check_operand_nalternatives (outputs, inputs))
      return;
--- 1493,1496 ----
*************** expand_asm_operands (string, outputs, in
*** 1592,1596 ****
  	  output_rtx[i]
  	    = expand_expr (TREE_VALUE (tail), NULL_RTX, VOIDmode,
! 			   EXPAND_MEMORY_USE_WO);
  
  	  if (! allows_reg && GET_CODE (output_rtx[i]) != MEM)
--- 1575,1579 ----
  	  output_rtx[i]
  	    = expand_expr (TREE_VALUE (tail), NULL_RTX, VOIDmode,
! 			   EXPAND_WRITE);
  
  	  if (! allows_reg && GET_CODE (output_rtx[i]) != MEM)
*************** expand_decl (decl)
*** 3988,3994 ****
  		&& TREE_CODE (type) == REAL_TYPE)
  	   && ! TREE_THIS_VOLATILE (decl)
! 	   && (DECL_REGISTER (decl) || optimize)
! 	   /* if -fcheck-memory-usage, check all variables.  */
! 	   && ! current_function_check_memory_usage)
      {
        /* Automatic variable that can go in a register.  */
--- 3971,3975 ----
  		&& TREE_CODE (type) == REAL_TYPE)
  	   && ! TREE_THIS_VOLATILE (decl)
! 	   && (DECL_REGISTER (decl) || optimize))
      {
        /* Automatic variable that can go in a register.  */
*** toplev.c	2001/12/05 07:46:42	1.552
--- toplev.c	2001/12/05 19:09:30
*************** int flag_stack_check;
*** 829,842 ****
  rtx stack_limit_rtx;
  
- /* -fcheck-memory-usage causes extra code to be generated in order to check
-    memory accesses.  This is used by a detector of bad memory accesses such
-    as Checker.  */
- int flag_check_memory_usage = 0;
- 
- /* -fprefix-function-name causes function name to be prefixed.  This
-    can be used with -fcheck-memory-usage to isolate code compiled with
-    -fcheck-memory-usage.  */
- int flag_prefix_function_name = 0;
- 
  /* 0 if pointer arguments may alias each other.  True in C.
     1 if pointer arguments may not alias each other but may alias
--- 829,832 ----
*************** lang_independent_options f_options[] =
*** 1138,1145 ****
    {"merge-all-constants", &flag_merge_constants, 2,
     N_("Attempt to merge identical constants and constant variables") },
-   {"check-memory-usage", &flag_check_memory_usage, 1,
-    N_("Generate code to check every memory access") },
-   {"prefix-function-name", &flag_prefix_function_name, 1,
-    N_("Add a prefix to all function names") },
    {"dump-unnumbered", &flag_dump_unnumbered, 1,
     N_("Suppress output of instruction numbers and line number notes in debugging dumps") },
--- 1128,1131 ----
*************** static void
*** 4816,4823 ****
  process_options ()
  {
-   /* Checker uses the frame pointer.  */
-   if (flag_check_memory_usage)
-     flag_omit_frame_pointer = 0;
- 
    if (optimize == 0)
      {
--- 4802,4805 ----
*** tree.h	2001/12/04 15:10:04	1.292
--- tree.h	2001/12/05 19:09:38
*************** struct tree_type
*** 1677,1685 ****
    (FUNCTION_DECL_CHECK (NODE)->decl.no_instrument_function_entry_exit)
  
- /* Used in FUNCTION_DECLs to indicate that check-memory-usage should be
-    disabled in this function.  */
- #define DECL_NO_CHECK_MEMORY_USAGE(NODE) \
-   (FUNCTION_DECL_CHECK (NODE)->decl.no_check_memory_usage)
- 
  /* Used in FUNCTION_DECLs to indicate that limit-stack-* should be
     disabled in this function.  */
--- 1677,1680 ----
*************** struct tree_decl
*** 1757,1772 ****
    unsigned non_addr_const_p : 1;
    unsigned no_instrument_function_entry_exit : 1;
-   unsigned no_check_memory_usage : 1;
    unsigned comdat_flag : 1;
    unsigned malloc_flag : 1;
    unsigned no_limit_stack : 1;
    ENUM_BITFIELD(built_in_class) built_in_class : 2;
- 
    unsigned pure_flag : 1;
    unsigned pointer_depth : 2;
    unsigned non_addressable : 1;
    unsigned user_align : 1;
    unsigned uninlinable : 1;
!   /* Two unused bits.  */
  
    unsigned lang_flag_0 : 1;
--- 1752,1766 ----
    unsigned non_addr_const_p : 1;
    unsigned no_instrument_function_entry_exit : 1;
    unsigned comdat_flag : 1;
    unsigned malloc_flag : 1;
    unsigned no_limit_stack : 1;
    ENUM_BITFIELD(built_in_class) built_in_class : 2;
    unsigned pure_flag : 1;
+ 
    unsigned pointer_depth : 2;
    unsigned non_addressable : 1;
    unsigned user_align : 1;
    unsigned uninlinable : 1;
!   /* Three unused bits.  */
  
    unsigned lang_flag_0 : 1;
*** varasm.c	2001/12/01 18:42:39	1.233
--- varasm.c	2001/12/05 19:09:48
*************** Software Foundation, 59 Temple Place - S
*** 62,69 ****
  #endif
  
- /* Define the prefix to use when check_memory_usage_flag is enable.  */
- #define CHKR_PREFIX "_CHKR_"
- #define CHKR_PREFIX_SIZE (sizeof (CHKR_PREFIX) - 1)
- 
  /* The (assembler) name of the first globally-visible object output.  */
  const char *first_global_object_name;
--- 62,65 ----
*************** make_decl_rtl (decl, asmspec)
*** 958,961 ****
--- 954,958 ----
      {
        char *label;
+ 
        ASM_FORMAT_PRIVATE_NAME (label, name, var_labelno);
        var_labelno++;
*************** make_decl_rtl (decl, asmspec)
*** 963,980 ****
      }
  
-   /* When -fprefix-function-name is used, the functions
-      names are prefixed.  Only nested function names are not
-      prefixed.  */
-   else if (flag_prefix_function_name && TREE_CODE (decl) == FUNCTION_DECL)
-     {
-       size_t name_len = IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (decl));
-       char *pname;
- 
-       pname = alloca (name_len + CHKR_PREFIX_SIZE + 1);
-       memcpy (pname, CHKR_PREFIX, CHKR_PREFIX_SIZE);
-       memcpy (pname + CHKR_PREFIX_SIZE, name, name_len + 1);
-       new_name = pname;
-     }
- 
    if (name != new_name)
      {
--- 960,963 ----
*************** assemble_name (file, name)
*** 1838,1844 ****
  
    STRIP_NAME_ENCODING (real_name, name);
-   if (flag_prefix_function_name
-       && ! memcmp (real_name, CHKR_PREFIX, CHKR_PREFIX_SIZE))
-     real_name = real_name + CHKR_PREFIX_SIZE;
  
    id = maybe_get_identifier (real_name);
--- 1821,1824 ----
*** cp/decl.c	2001/12/03 23:15:09	1.832
--- cp/decl.c	2001/12/05 19:10:24
*************** duplicate_decls (newdecl, olddecl)
*** 3587,3592 ****
  	  DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (newdecl)
  	    |= DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (olddecl);
- 	  DECL_NO_CHECK_MEMORY_USAGE (newdecl)
- 	    |= DECL_NO_CHECK_MEMORY_USAGE (olddecl);
  	  DECL_NO_LIMIT_STACK (newdecl)
  	    |= DECL_NO_LIMIT_STACK (olddecl);
--- 3587,3590 ----
*** doc/extend.texi	2001/12/04 22:55:38	1.39
--- doc/extend.texi	2001/12/05 19:11:17
*************** attributes are currently defined for fun
*** 1918,1926 ****
  @code{format}, @code{format_arg}, @code{no_instrument_function},
  @code{section}, @code{constructor}, @code{destructor}, @code{used},
! @code{unused}, @code{weak}, @code{malloc}, @code{alias} and
! @code{no_check_memory_usage}.  Several other attributes are defined for
! functions on particular target systems.  Other attributes, including
! @code{section} are supported for variables declarations (@pxref{Variable
! Attributes}) and for types (@pxref{Type Attributes}).
  
  You may also specify attributes with @samp{__} preceding and following
--- 1918,1926 ----
  @code{format}, @code{format_arg}, @code{no_instrument_function},
  @code{section}, @code{constructor}, @code{destructor}, @code{used},
! @code{unused}, @code{weak}, @code{malloc}, and @code{alias}.  Several
! other attributes are defined for functions on particular target systems.
! Other attributes, including @code{section} are supported for variables
! declarations (@pxref{Variable Attributes}) and for types (@pxref{Type
! Attributes}).
  
  You may also specify attributes with @samp{__} preceding and following
*************** mangled name for the target must be used
*** 2212,2232 ****
  
  Not all target machines support this attribute.
- 
- @item no_check_memory_usage
- @cindex @code{no_check_memory_usage} function attribute
- @opindex fcheck-memory-usage
- The @code{no_check_memory_usage} attribute causes GCC to omit checks
- of memory references when it generates code for that function.  Normally
- if you specify @option{-fcheck-memory-usage} (see @pxref{Code Gen
- Options}), GCC generates calls to support routines before most memory
- accesses to permit support code to record usage and detect uses of
- uninitialized or unallocated storage.  Since GCC cannot handle
- @code{asm} statements properly they are not allowed in such functions.
- If you declare a function with this attribute, GCC will not generate
- memory checking code for that function, permitting the use of @code{asm}
- statements without having to compile that function with different
- options.  This also allows you to write support routines of your own if
- you wish, without getting infinite recursion if they get compiled with
- @option{-fcheck-memory-usage}.
  
  @item regparm (@var{number})
--- 2212,2215 ----
*** doc/invoke.texi	2001/12/05 12:36:46	1.83
--- doc/invoke.texi	2001/12/05 19:11:43
*************** in the following sections.
*** 618,622 ****
  -fnon-call-exceptions  -funwind-tables -fasynchronous-unwind-tables @gol
  -finhibit-size-directive  -finstrument-functions @gol
- -fcheck-memory-usage  -fprefix-function-name @gol
  -fno-common  -fno-ident  -fno-gnu-linker @gol
  -fpcc-struct-return  -fpic  -fPIC @gol
--- 618,621 ----
*************** Pack all structure members together with
*** 9988,10060 ****
  not want to use this option, since it makes the code suboptimal, and
  the offsets of structure members won't agree with system libraries.
- 
- @item -fcheck-memory-usage
- @opindex fcheck-memory-usage
- Generate extra code to check each memory access.  GCC will generate
- code that is suitable for a detector of bad memory accesses such as
- @file{Checker}.
- 
- Normally, you should compile all, or none, of your code with this option.
- 
- If you do mix code compiled with and without this option,
- you must ensure that all code that has side effects
- and that is called by code compiled with this option
- is, itself, compiled with this option.
- If you do not, you might get erroneous messages from the detector.
- 
- If you use functions from a library that have side-effects (such as
- @code{read}), you might not be able to recompile the library and
- specify this option.  In that case, you can enable the
- @option{-fprefix-function-name} option, which requests GCC to encapsulate
- your code and make other functions look as if they were compiled with
- @option{-fcheck-memory-usage}.  This is done by calling ``stubs'',
- which are provided by the detector.  If you cannot find or build
- stubs for every function you call, you might have to specify
- @option{-fcheck-memory-usage} without @option{-fprefix-function-name}.
- 
- If you specify this option, you can not use the @code{asm} or
- @code{__asm__} keywords in functions with memory checking enabled.  GCC
- cannot understand what the @code{asm} statement may do, and therefore
- cannot generate the appropriate code, so it will reject it.  However, if
- you specify the function attribute @code{no_check_memory_usage}
- (@pxref{Function Attributes}), GCC will disable memory checking within a
- function; you may use @code{asm} statements inside such functions.  You
- may have an inline expansion of a non-checked function within a checked
- function; in that case GCC will not generate checks for the inlined
- function's memory accesses.
- 
- If you move your @code{asm} statements to non-checked inline functions
- and they do access memory, you can add calls to the support code in your
- inline function, to indicate any reads, writes, or copies being done.
- These calls would be similar to those done in the stubs described above.
- 
- @item -fprefix-function-name
- @opindex fprefix-function-name
- Request GCC to add a prefix to the symbols generated for function names.
- GCC adds a prefix to the names of functions defined as well as
- functions called.  Code compiled with this option and code compiled
- without the option can't be linked together, unless stubs are used.
- 
- If you compile the following code with @option{-fprefix-function-name}
- @example
- extern void bar (int);
- void
- foo (int a)
- @{
-   return bar (a + 5);
- @}
- @end example
- 
- @noindent
- GCC will compile the code as if it was written:
- @example
- extern void prefix_bar (int);
- void
- prefix_foo (int a)
- @{
-   return prefix_bar (a + 5);
- @}
- @end example
- This option is designed to be used with @option{-fcheck-memory-usage}.
  
  @item -finstrument-functions
--- 9987,9990 ----


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