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]

[tree-ssa mudflap] instrumentation tweaks


Hi -


I'm about to apply the following patch.  It does a couple of things:
* adds the -fmudflap->-fno-merge-constants logic we discussed last
  week; conditional on flag_mudflap to keep it non-controversial
* avoids generating SAVE_EXPRs in array bounds checking instrumentation,
  and another construct, each of which could upset other parts of the compiler
* allows gcc to finally bootstrap with -fmudflap (with or without
  -fdisable-simple).  The runtime still needs work to avoid some new
  spurious-looking violation warnings.

- FChE


Index: ChangeLog.tree-ssa
+ 2002-09-20  Frank Ch. Eigler  <fche@redhat.com>
+ 
+ 	* gcc.c (cc1_options): Make -fmudflap imply -fno-merge-constants.
+ 	* varasm.c (categorize_decl_for_section): Likewise, for strings.
+ 	* tree-mudflap.c (mudflap_enqueue_decl): Don't be interested
+ 	in !TREE_USED decls.  Fix minor type warning.
+ 	(mf_offset_expr_of_array_ref): Create explicit temporary variables
+ 	for array index expressions instead of SAVE_EXPRs.  Update callers.
+ 	(mf_build_check_statement_for): Insert temp variables.
+ 	(mx_xfn_indirect_ref): Correct recursion-protection checking
+ 	sequence.  Tweak array check-base calculation back to "&array[0]".
+ 	(*): Use build_function_type_list instead of build_function_type.
+ 	(mx_external_ref): Remove unused parameter.  Update callers.
+ 

Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.324.2.12
diff -c -p -w -r1.324.2.12 gcc.c
*** gcc.c	20 Sep 2002 13:27:03 -0000	1.324.2.12
--- gcc.c	20 Sep 2002 17:25:29 -0000
*************** static const char *cc1_options =
*** 738,744 ****
   %{--target-help:--target-help}\
   %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
   %{fsyntax-only:-o %j} %{-param*}\
!  %{fmudflap:-fmudflap -fno-builtin}";
  
  static const char *asm_options =
  "%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
--- 738,744 ----
   %{--target-help:--target-help}\
   %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
   %{fsyntax-only:-o %j} %{-param*}\
!  %{fmudflap:-fmudflap -fno-builtin -fno-merge-constants}";
  
  static const char *asm_options =
  "%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.295.2.10
diff -c -p -w -r1.295.2.10 varasm.c
*** varasm.c	20 Sep 2002 13:27:12 -0000	1.295.2.10
--- varasm.c	20 Sep 2002 17:25:29 -0000
*************** categorize_decl_for_section (decl, reloc
*** 4966,4971 ****
--- 4966,4973 ----
      {
        if (flag_writable_strings)
  	return SECCAT_DATA;
+       else if (flag_mudflap) /* or !flag_merge_constants */
+         return SECCAT_RODATA;
        else
  	return SECCAT_RODATA_MERGE_STR;
      }
Index: tree-mudflap.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-mudflap.c,v
retrieving revision 1.1.2.13
diff -c -p -w -r1.1.2.13 tree-mudflap.c
*** tree-mudflap.c	9 Sep 2002 21:29:14 -0000	1.1.2.13
--- tree-mudflap.c	20 Sep 2002 17:25:29 -0000
*************** static tree mf_file_function_line_tree P
*** 55,68 ****
  static void mf_enqueue_register_call PARAMS ((const char*, tree, tree, tree));
  static void mf_flush_enqueued_calls PARAMS ((void));
  static tree mf_mostly_copy_tree_r PARAMS ((tree *, int *, void *));
! static tree mx_external_ref PARAMS ((tree, int));
  static tree mx_flag PARAMS ((tree));
  static tree mx_xfn_indirect_ref PARAMS ((tree *, int *, void *));
  static tree mx_xfn_xform_decls PARAMS ((tree *, int *, void *));
  static tree mx_xfn_find_addrof PARAMS ((tree *, int *, void *));
  
! static tree mf_offset_expr_of_array_ref PARAMS ((tree, tree, tree *));
! static tree mf_build_check_statement_for PARAMS ((tree, tree, tree, const char *, int));
  static void mx_register_decl PARAMS ((tree *, tree, tree));
  
  
--- 55,69 ----
  static void mf_enqueue_register_call PARAMS ((const char*, tree, tree, tree));
  static void mf_flush_enqueued_calls PARAMS ((void));
  static tree mf_mostly_copy_tree_r PARAMS ((tree *, int *, void *));
! static tree mx_external_ref PARAMS ((tree));
  static tree mx_flag PARAMS ((tree));
  static tree mx_xfn_indirect_ref PARAMS ((tree *, int *, void *));
  static tree mx_xfn_xform_decls PARAMS ((tree *, int *, void *));
  static tree mx_xfn_find_addrof PARAMS ((tree *, int *, void *));
  
! static tree mf_offset_expr_of_array_ref PARAMS ((tree, tree *, tree *, tree *));
! static tree mf_build_check_statement_for PARAMS ((tree, tree, tree, tree, 
! 						  const char *, int));
  static void mx_register_decl PARAMS ((tree *, tree, tree));
  
  
*************** mudflap_enqueue_decl (obj, label)
*** 147,153 ****
    fprintf (stderr, "' label=`%s'\n", label);
    */
  
!   if (COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (obj)))
      {
        mf_enqueue_register_call (label,
  				c_size_in_bytes (TREE_TYPE (obj)),
--- 148,155 ----
    fprintf (stderr, "' label=`%s'\n", label);
    */
  
!   if (COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (obj)) 
!       && TREE_USED (obj) /* && TREE_ADDRESSABLE (obj) ??? */)
      {
        mf_enqueue_register_call (label,
  				c_size_in_bytes (TREE_TYPE (obj)),
*************** mudflap_enqueue_decl (obj, label)
*** 178,184 ****
        else
  	{
  	  VARRAY_PUSH_TREE (deferred_static_decls, obj);
! 	  VARRAY_PUSH_CHAR_PTR (deferred_static_decl_labels, label);
  	}
      }
  }
--- 180,186 ----
        else
  	{
  	  VARRAY_PUSH_TREE (deferred_static_decls, obj);
! 	  VARRAY_PUSH_CHAR_PTR (deferred_static_decl_labels, (char *) label);
  	}
      }
  }
*************** mf_init_extern_trees ()
*** 318,361 ****
    mx_flag (mf_cache_mask_decl);
  
    mf_check_fndecl = build_decl (FUNCTION_DECL, get_identifier ("__mf_check"),
! 				build_function_type 
! 				(void_type_node,
! 				 tree_cons (NULL_TREE,
  					    mf_uintptr_type,
- 					    tree_cons (NULL_TREE, 
  						       mf_uintptr_type,
- 						       tree_cons (NULL_TREE,
  								  const_string_type_node,
! 								  NULL_TREE)))));
    DECL_EXTERNAL (mf_check_fndecl) = 1;
    DECL_ARTIFICIAL (mf_check_fndecl) = 1;
    TREE_PUBLIC (mf_check_fndecl) = 1;
  
    mf_register_fndecl = build_decl (FUNCTION_DECL, get_identifier ("__mf_register"),
! 				   build_function_type
! 				   (void_type_node,
! 				    tree_cons (NULL_TREE,
  					       mf_uintptr_type,
- 					       tree_cons (NULL_TREE, 
  							  mf_uintptr_type,
- 							  tree_cons (NULL_TREE,
  								     integer_type_node,
- 								     tree_cons (NULL_TREE,
  										const_string_type_node,
! 										NULL_TREE))))));
    
    DECL_EXTERNAL (mf_register_fndecl) = 1;
    DECL_ARTIFICIAL (mf_register_fndecl) = 1;
    TREE_PUBLIC (mf_register_fndecl) = 1;
  
    mf_unregister_fndecl = build_decl (FUNCTION_DECL, get_identifier ("__mf_unregister"),
! 				   build_function_type 
! 				     (void_type_node,
! 				      tree_cons (NULL_TREE,
  						 mf_uintptr_type,
- 						 tree_cons (NULL_TREE, 
  							    mf_uintptr_type,
! 							    NULL_TREE))));
    DECL_EXTERNAL (mf_unregister_fndecl) = 1;
    DECL_ARTIFICIAL (mf_unregister_fndecl) = 1;
    TREE_PUBLIC (mf_unregister_fndecl) = 1;
--- 320,351 ----
    mx_flag (mf_cache_mask_decl);
  
    mf_check_fndecl = build_decl (FUNCTION_DECL, get_identifier ("__mf_check"),
! 				build_function_type_list (void_type_node,
  							  mf_uintptr_type,
  							  mf_uintptr_type,
  							  const_string_type_node,
! 							  NULL_TREE));
    DECL_EXTERNAL (mf_check_fndecl) = 1;
    DECL_ARTIFICIAL (mf_check_fndecl) = 1;
    TREE_PUBLIC (mf_check_fndecl) = 1;
  
    mf_register_fndecl = build_decl (FUNCTION_DECL, get_identifier ("__mf_register"),
! 				   build_function_type_list (void_type_node,
  							     mf_uintptr_type,
  							     mf_uintptr_type,
  							     integer_type_node,
  							     const_string_type_node,
! 							     NULL_TREE));
    
    DECL_EXTERNAL (mf_register_fndecl) = 1;
    DECL_ARTIFICIAL (mf_register_fndecl) = 1;
    TREE_PUBLIC (mf_register_fndecl) = 1;
  
    mf_unregister_fndecl = build_decl (FUNCTION_DECL, get_identifier ("__mf_unregister"),
! 				   build_function_type_list (void_type_node,
  							     mf_uintptr_type,
  							     mf_uintptr_type,
! 							     NULL_TREE));
    DECL_EXTERNAL (mf_unregister_fndecl) = 1;
    DECL_ARTIFICIAL (mf_unregister_fndecl) = 1;
    TREE_PUBLIC (mf_unregister_fndecl) = 1;
*************** mx_flag (t)
*** 391,399 ****
  
  /* This is a derivative / subset of build_external_ref in c-typeck.c.  */
  static tree
! mx_external_ref (t, fun)
       tree t;
-      int fun;
  {
    assemble_external (t);
    TREE_USED (t) = 1;
--- 381,388 ----
  
  /* This is a derivative / subset of build_external_ref in c-typeck.c.  */
  static tree
! mx_external_ref (t)
       tree t;
  {
    assemble_external (t);
    TREE_USED (t) = 1;
*************** mf_file_function_line_tree (file, line)
*** 571,581 ****
  */
  
  static tree 
! mf_offset_expr_of_array_ref (t, offset, base)
       tree t;
!      tree offset;
       tree *base;
  {
    if ( TREE_CODE (t) == ARRAY_REF )
      {
        /* It's a sub-array-ref; recurse. */
--- 560,598 ----
  */
  
  static tree 
! mf_offset_expr_of_array_ref (t, offset, base, decls)
       tree t;
!      tree *offset;
       tree *base;
+      tree *decls;
  {
+   /* Replace the array index operand [1] with a temporary variable.
+      This is meant to emulate SAVE_EXPRs that are sometimes screwed up
+      by other parts of gcc.  */
+   if (TREE_CODE (t) == ARRAY_REF ||
+       TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
+     {
+       static unsigned declindex;
+       char declname[20];
+       tree newdecl, idxexpr;
+ 
+       idxexpr = *offset;
+       sprintf (declname, "__mf_index_%u", declindex++);
+ 
+       newdecl = build_decl (VAR_DECL, get_identifier (declname),
+ 			    TREE_TYPE (idxexpr));
+       DECL_ARTIFICIAL (newdecl) = 1;
+       DECL_INITIAL (newdecl) = idxexpr;
+ 
+       /* Accumulate this new decl. */
+       *decls = tree_cons (TREE_TYPE (idxexpr),
+ 			  newdecl,
+ 			  *decls);
+ 
+       /* Replace the index expression with the plain VAR_DECL reference.  */
+       *offset = newdecl;
+     }
+ 
    if (TREE_CODE (t) == ARRAY_REF)
      {
        /* It's a sub-array-ref; recurse. */
*************** mf_offset_expr_of_array_ref (t, offset, 
*** 583,613 ****
        tree factor = fold (build (PLUS_EXPR, 
  				 integer_type_node, 
  				 integer_one_node, 
! 				 TYPE_MAX_VALUE 
! 				 (TYPE_DOMAIN (TREE_TYPE (t)))));
!       tree child = TREE_OPERAND (t, 0);
!       tree next_offset = TREE_OPERAND (t, 1);
  
!       /* Wrap the inner index in a SAVE_EXPR to prevent multiple evaluation.  */
!       TREE_OPERAND (t, 1) = save_expr (TREE_OPERAND (t, 1));
! 
!       /* mark this node to inhibit further transformation */
        mx_flag (t);
        
        return 
! 	fold (build (PLUS_EXPR, integer_type_node, offset, 
  		     fold (build (MULT_EXPR, integer_type_node, factor, 
! 				  mf_offset_expr_of_array_ref (child, 
! 							       next_offset,
! 							       base)))));
      } 
    else if ( TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE )
      {
!       /* It's *not* an ARRAY_REF, but it *is* an ARRAY_TYPE; we are at the
! 	 bottom of the ARRAY_REF expression */ 
        *base = t;
  
!       return offset;
      }
    else 
      {
--- 600,625 ----
        tree factor = fold (build (PLUS_EXPR, 
  				 integer_type_node, 
  				 integer_one_node, 
! 				 TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (t)))));
  
!       /* Mark this node to inhibit further transformation.  */
        mx_flag (t);
        
        return
! 	fold (build (PLUS_EXPR, integer_type_node, *offset, 
  		     fold (build (MULT_EXPR, integer_type_node, factor, 
! 				  mf_offset_expr_of_array_ref (TREE_OPERAND (t, 0), 
! 							       & TREE_OPERAND (t, 1),
! 							       base,
! 							       decls)))));
      } 
    else if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
      {
!       /* It's *not* an ARRAY_REF, but it *is* an ARRAY_TYPE; we are at
! 	 the bottom of the ARRAY_REF expression.  */ 
        *base = t;
  
!       return *offset;
      }
    else 
      {
*************** mf_offset_expr_of_array_ref (t, offset, 
*** 618,627 ****
  
  
  static tree 
! mf_build_check_statement_for (ptrvalue, chkbase, chksize, filename, lineno)
       tree ptrvalue;
       tree chkbase;
       tree chksize;
       const char *filename;
       int lineno;
  {
--- 630,641 ----
  
  
  static tree 
! mf_build_check_statement_for (ptrvalue, chkbase, chksize, 
! 			      chkdecls, filename, lineno)
       tree ptrvalue;
       tree chkbase;
       tree chksize;
+      tree chkdecls;
       const char *filename;
       int lineno;
  {
*************** mf_build_check_statement_for (ptrvalue, 
*** 630,635 ****
--- 644,650 ----
    tree location_string;
  
    tree t1_1;
+   tree t1_1a;
    tree t1_2, t1_2_1;
    tree t1_2a, t1_2a_1;
    tree t1_2b, t1_2b_1;
*************** mf_build_check_statement_for (ptrvalue, 
*** 650,661 ****
    
    pushlevel (0);
  
    /* <TYPE> const __mf_value = <EXPR>; */
    t1_2_1 = build_decl (VAR_DECL, get_identifier ("__mf_value"), myptrtype);
    DECL_ARTIFICIAL (t1_2_1) = 1;
    DECL_INITIAL (t1_2_1) = ptrvalue;
    t1_2 = build1 (DECL_STMT, myptrtype, pushdecl (t1_2_1));
!   TREE_CHAIN (t1_1) = t1_2;
  
    /* uintptr_t __mf_base = <EXPR2>; */
    t1_2a_1 = build_decl (VAR_DECL, get_identifier ("__mf_base"), mf_uintptr_type);
--- 665,689 ----
    
    pushlevel (0);
  
+   /* Insert any supplied helper declarations.  */
+   t1_1a = t1_1;
+   while (chkdecls != NULL_TREE)
+     {
+       tree decl = TREE_VALUE (chkdecls);
+       tree type = TREE_PURPOSE (chkdecls);
+       tree declstmt = build1 (DECL_STMT, type, pushdecl (decl));
+ 
+       TREE_CHAIN (t1_1a) = declstmt;
+       t1_1a = declstmt;
+       chkdecls = TREE_CHAIN (chkdecls);
+     }
+ 
    /* <TYPE> const __mf_value = <EXPR>; */
    t1_2_1 = build_decl (VAR_DECL, get_identifier ("__mf_value"), myptrtype);
    DECL_ARTIFICIAL (t1_2_1) = 1;
    DECL_INITIAL (t1_2_1) = ptrvalue;
    t1_2 = build1 (DECL_STMT, myptrtype, pushdecl (t1_2_1));
!   TREE_CHAIN (t1_1a) = t1_2;
  
    /* uintptr_t __mf_base = <EXPR2>; */
    t1_2a_1 = build_decl (VAR_DECL, get_identifier ("__mf_base"), mf_uintptr_type);
*************** mf_build_check_statement_for (ptrvalue, 
*** 684,695 ****
  		     mx_flag (build (ARRAY_REF, TYPE_MAIN_VARIANT (TREE_TYPE
  								   (TREE_TYPE
  								    (mf_cache_array_decl))),
! 				     mx_external_ref (mf_cache_array_decl, 0),
  				     build (BIT_AND_EXPR, mf_uintptr_type,
  					    build (RSHIFT_EXPR, mf_uintptr_type,
  						   convert (mf_uintptr_type, t1_2a_1),
! 						   mx_external_ref (mf_cache_shift_decl, 0)),
! 					    mx_external_ref (mf_cache_mask_decl, 0))))));
    
    t1_3 = build1 (DECL_STMT, mf_cache_structptr_type, pushdecl (t1_3_1));
    TREE_CHAIN (t1_2b) = t1_3;
--- 712,723 ----
  		     mx_flag (build (ARRAY_REF, TYPE_MAIN_VARIANT (TREE_TYPE
  								   (TREE_TYPE
  								    (mf_cache_array_decl))),
! 				     mx_external_ref (mf_cache_array_decl),
  				     build (BIT_AND_EXPR, mf_uintptr_type,
  					    build (RSHIFT_EXPR, mf_uintptr_type,
  						   convert (mf_uintptr_type, t1_2a_1),
! 						   mx_external_ref (mf_cache_shift_decl)),
! 					    mx_external_ref (mf_cache_mask_decl))))));
    
    t1_3 = build1 (DECL_STMT, mf_cache_structptr_type, pushdecl (t1_3_1));
    TREE_CHAIN (t1_2b) = t1_3;
*************** mf_build_check_statement_for (ptrvalue, 
*** 721,727 ****
  						      integer_zero_node,
  						      NULL_TREE)));
    
!   t1_4_2 = build_function_call (mx_external_ref (mf_check_fndecl, 1),
  				tree_cons (NULL_TREE,
  					   t1_2a_1,
  					   tree_cons (NULL_TREE, 
--- 749,755 ----
  						      integer_zero_node,
  						      NULL_TREE)));
    
!   t1_4_2 = build_function_call (mx_external_ref (mf_check_fndecl),
  				tree_cons (NULL_TREE,
  					   t1_2a_1,
  					   tree_cons (NULL_TREE, 
*************** mx_xfn_indirect_ref (t, continue_p, data
*** 814,824 ****
        last_lineno = (EXPR_WFL_LINENO (*t) > 0 ? EXPR_WFL_LINENO (*t) : last_lineno);
      }
  
-   /* Avoid infinite recursion of transforming instrumented or
-      instrumentation code. */
-   if (TREE_MUDFLAPPED_P (*t))
-     return NULL_TREE;
- 
    /* Avoid traversal into subtrees specifically listed as
       do-not-traverse.  This occurs for certain nested operator/array
       expressions.  */
--- 842,847 ----
*************** mx_xfn_indirect_ref (t, continue_p, data
*** 828,833 ****
--- 851,863 ----
        return NULL_TREE;
      }
  
+   /* Avoid infinite recursion of transforming instrumented or
+      instrumentation code.  NB: This check is done second, in case the
+      same node is marked verboten as well as mudflapped.  The former
+      takes priority, and is meant to prevent further traversal.  */
+   if (TREE_MUDFLAPPED_P (*t))
+     return NULL_TREE;
+ 
    /* Process some node types.  */
    switch (TREE_CODE (*t))
      {
*************** mx_xfn_indirect_ref (t, continue_p, data
*** 841,854 ****
  	tree offset_expr;
  	tree value_ptr, check_ptr, check_size;
  	tree tmp;
  
! 	/* Wrap the outermost index in a SAVE_EXPR to prevent multiple evaluation.  */
! 	TREE_OPERAND (*t, 1) = save_expr (TREE_OPERAND (*t, 1));
  
  	offset_expr = mf_offset_expr_of_array_ref (TREE_OPERAND (*t,0), 
! 						   TREE_OPERAND (*t,1), 
! 						   &base_array);
! 	/* walk_tree (& offset_expr, mf_mostly_copy_tree_r, NULL, NULL); */
  	
  	/* We now have a tree representing the array in base_array, 
  	   and a tree representing the complete desired offset in
--- 871,886 ----
  	tree offset_expr;
  	tree value_ptr, check_ptr, check_size;
  	tree tmp;
+ 	tree check_decls = NULL_TREE;
  
! 	/* Unshare the whole darned tree.  */
! 	walk_tree (t, mf_mostly_copy_tree_r, NULL, NULL);
  
  	offset_expr = mf_offset_expr_of_array_ref (TREE_OPERAND (*t,0), 
! 						   & TREE_OPERAND (*t,1), 
! 						   & base_array,
! 						   & check_decls);
! 	check_decls = nreverse (check_decls); /* XXX: evaluation order?  */
  
  	/* We now have a tree representing the array in base_array, 
  	   and a tree representing the complete desired offset in
*************** mx_xfn_indirect_ref (t, continue_p, data
*** 857,868 ****
  	base_obj_type = TREE_TYPE (TREE_TYPE (TREE_OPERAND(*t,0)));
  	base_ptr_type = build_pointer_type (base_obj_type);
  
- 	/* NB: Previously, this was (& base_array[0]) */
- 	/* XXX: subset of default_conversion() for arrays */
  	check_ptr = mx_flag (build1 (ADDR_EXPR, 
  				     base_ptr_type, 
! 				     base_array));
! 	/* walk_tree (& check_ptr, mf_mostly_copy_tree_r, NULL, NULL); */
  	TREE_ADDRESSABLE (base_array) = 1;
  
  	value_ptr = mx_flag (build1 (ADDR_EXPR,
--- 889,900 ----
  	base_obj_type = TREE_TYPE (TREE_TYPE (TREE_OPERAND(*t,0)));
  	base_ptr_type = build_pointer_type (base_obj_type);
  
          check_ptr = mx_flag (build1 (ADDR_EXPR, 
  				     base_ptr_type, 
! 				     mx_flag (build (ARRAY_REF, 
! 						     base_obj_type, 
! 						     base_array,
! 						     integer_zero_node))));
  	TREE_ADDRESSABLE (base_array) = 1;
  
  	value_ptr = mx_flag (build1 (ADDR_EXPR,
*************** mx_xfn_indirect_ref (t, continue_p, data
*** 882,889 ****
--- 914,923 ----
  	   following call is meant to eliminate the
  	   redundant/recursive check of the outer size=b[c] check. */
  	* (htab_find_slot (verboten, check_size, INSERT)) = check_size;
+ 	* (htab_find_slot (verboten, check_ptr, INSERT)) = check_ptr;
    
  	tmp = mf_build_check_statement_for (value_ptr, check_ptr, check_size,
+ 					    check_decls,
  					    last_filename, last_lineno);
  	*t = mx_flag (build1 (INDIRECT_REF, base_obj_type, tmp));
        }
*************** mx_xfn_indirect_ref (t, continue_p, data
*** 902,908 ****
  				      TYPE_SIZE_UNIT (TREE_TYPE
  						      (TREE_TYPE
  						       (TREE_OPERAND (*t, 0)))),
! 				      last_filename, last_lineno);
  	/* Prevent this transform's reapplication to this tree node.
  	   Note that we do not prevent recusion in walk_tree toward
  	   subtrees of this node, in case of nested pointer expressions.  */
--- 936,942 ----
  				      TYPE_SIZE_UNIT (TREE_TYPE
  						      (TREE_TYPE
  						       (TREE_OPERAND (*t, 0)))),
! 				      NULL_TREE, last_filename, last_lineno);
  	/* Prevent this transform's reapplication to this tree node.
  	   Note that we do not prevent recusion in walk_tree toward
  	   subtrees of this node, in case of nested pointer expressions.  */
*************** mx_xfn_indirect_ref (t, continue_p, data
*** 923,928 ****
--- 957,963 ----
  	    mf_build_check_statement_for (*pointer,
  					  *pointer,
  					  check_size,
+ 					  NULL_TREE,
  					  last_filename, last_lineno);
  	  
  	  /* Don't instrument the nested INDIRECT_REF. */ 
*************** mx_register_decl (posn, decl, containing
*** 993,999 ****
  			      NULL_TREE));
        /* __mf_unregister (...) */
        tree unregister_fncall =
! 	build_function_call (mx_external_ref (mf_unregister_fndecl, 1),
  			     unregister_fncall_params);
        
        tree cleanup_stmt = build_stmt (CLEANUP_STMT, decl, unregister_fncall);
--- 1028,1034 ----
  			      NULL_TREE));
        /* __mf_unregister (...) */
        tree unregister_fncall =
! 	build_function_call (mx_external_ref (mf_unregister_fndecl),
  			     unregister_fncall_params);
        
        tree cleanup_stmt = build_stmt (CLEANUP_STMT, decl, unregister_fncall);
*************** mx_register_decl (posn, decl, containing
*** 1016,1022 ****
  						    NULL_TREE))));
        /* __mf_register (...) */
        tree register_fncall =
! 	build_function_call (mx_external_ref (mf_register_fndecl, 1),
  			     register_fncall_params);
        
        tree register_fncall_stmt =
--- 1051,1057 ----
  						    NULL_TREE))));
        /* __mf_register (...) */
        tree register_fncall =
! 	build_function_call (mx_external_ref (mf_register_fndecl),
  			     register_fncall_params);
        
        tree register_fncall_stmt =
*************** mf_enqueue_register_call (label, regsize
*** 1247,1253 ****
  							    NULL_TREE))));
  
    call_stmt = build1 (EXPR_STMT, void_type_node,
! 		      build_function_call (mx_external_ref (mf_register_fndecl, 1),
  					   call_params));
  
    /* Link this call into the chain. */
--- 1282,1288 ----
  							    NULL_TREE))));
  
    call_stmt = build1 (EXPR_STMT, void_type_node,
! 		      build_function_call (mx_external_ref (mf_register_fndecl),
  					   call_params));
  
    /* Link this call into the chain. */


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