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]

Add missing static vars in mudflap


Hi,
testing tree-ssa-operands changes uncovered this latent problem in
tree-mudflap.  The new references to static vars are being added to code
without proper add_referenced_var.  This apparently worked by
interesting accident that annotations wasn't removed and we actually
never really checked that referenced vars list is correct.

Bootstrapped/regtested x86_64-linux, comitted as obvious.

Honza

Index: ChangeLog
===================================================================
*** ChangeLog	(revision 120187)
--- ChangeLog	(working copy)
***************
*** 1,3 ****
--- 1,8 ----
+ 2006-12-24  Jan Hubicka  <jh@suse.cz>
+ 
+ 	* tree-mudflap.c (ml_decl_cache_locals, md_build_check_statement_for):
+ 	add newly referenced vars.
+ 
  2006-12-24  Kazu Hirata  <kazu@codesourcery.com>
  
  	* basic-block.h: Remove the prototype for
Index: tree-mudflap.c
===================================================================
*** tree-mudflap.c	(revision 120187)
--- tree-mudflap.c	(working copy)
*************** mf_decl_cache_locals (void)
*** 460,471 ****
--- 460,473 ----
       globals into the cache variables.  */
    t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (mf_cache_shift_decl_l),
                mf_cache_shift_decl_l, mf_cache_shift_decl);
+   add_referenced_var (mf_cache_shift_decl);
    SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
    gimplify_to_stmt_list (&t);
    shift_init_stmts = t;
  
    t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (mf_cache_mask_decl_l),
                mf_cache_mask_decl_l, mf_cache_mask_decl);
+   add_referenced_var (mf_cache_mask_decl);
    SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
    gimplify_to_stmt_list (&t);
    mask_init_stmts = t;
*************** mf_build_check_statement_for (tree base,
*** 571,583 ****
--- 573,589 ----
                                              & __mf_mask].  */
    t = build2 (RSHIFT_EXPR, mf_uintptr_type, mf_base,
                (flag_mudflap_threads ? mf_cache_shift_decl : mf_cache_shift_decl_l));
+   add_referenced_var (mf_cache_shift_decl);
    t = build2 (BIT_AND_EXPR, mf_uintptr_type, t,
                (flag_mudflap_threads ? mf_cache_mask_decl : mf_cache_mask_decl_l));
+   add_referenced_var (mf_cache_mask_decl);
    t = build4 (ARRAY_REF,
                TREE_TYPE (TREE_TYPE (mf_cache_array_decl)),
                mf_cache_array_decl, t, NULL_TREE, NULL_TREE);
+   add_referenced_var (mf_cache_array_decl);
    t = build1 (ADDR_EXPR, mf_cache_structptr_type, t);
    t = build2 (GIMPLE_MODIFY_STMT, void_type_node, mf_elem, t);
+   add_referenced_var (mf_elem);
    SET_EXPR_LOCUS (t, locus);
    gimplify_to_stmt_list (&t);
    tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
*************** mf_build_check_statement_for (tree base,
*** 601,606 ****
--- 607,613 ----
                build1 (INDIRECT_REF, mf_cache_struct_type, mf_elem),
                TYPE_FIELDS (mf_cache_struct_type), NULL_TREE);
    t = build2 (GT_EXPR, boolean_type_node, t, mf_base);
+   add_referenced_var (mf_base);
  
    /* Construct '__mf_elem->high < __mf_limit'.
  


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