From: davidxl Date: Wed, 28 Apr 2010 17:41:31 +0000 (+0000) Subject: predicate aware uninitialized analysis X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=e41faa3346586846783b7841a6af96fa1bf49ab1;hp=bf5359dec5431f62abbe8bbcf5a4bff3741257c8 predicate aware uninitialized analysis git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158835 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e418533f01..c84d857011d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,49 @@ +2010-04-28 Xinliang David Li + + PR c/42643 + * tree-ssa-uninit.c (can_skip_redundant_opnd): New function. + (compute_uninit_opnds_pos): New function. + (is_non_loop_exit_postdominating): New function. + (compute_control_dep_chain): New function. + (find_pdom): New function. + (convert_control_dep_chain_into_preds): New function. + (find_predicates): New function. + (find_control_equiv_block): New function. + (collect_phi_def_edges): New function. + (find_def_preds): New function. + (find_dom): New function. + (dump_predicates): New function. + (get_cmp_code): New function. + (is_value_included_in): New function. + (find_matching_predicate_in_rest_chains): New function. + (use_pred_not_overlap_with_undef_path_pred): New function. + (is_use_properly_guarded): New function. + (normalize_cond_1): New function. + (is_and_or_or): New function. + (normalize_cond): New function. + (is_gcond_subset_of): New function. + (is_subset_of_any): New function. + (is_or_set_subset_of): New function. + (is_and_set_subset_of): New function. + (is_norm_cond_subset_of): New function. + (is_pred_expr_subset_of): New function. + (is_pred_chain_subset_of): New function. + (is_included_in): New function. + (is_superset_of): New function. + (find_uninit_use): New function. + (warn_uninitialized_phi): New function. + (compute_possibly_undefined_names): New function. + (ssa_undefined_value_p): New function. + (execute_late_warn_uninitialized): New function. + * tree-ssa.c (ssa_undefined_value_p): Removed. + (warn_uninit): Changed to extern. + (warn_uninitialized_phi): Removed. + (warn_uninitialized_vars): Changed to extern. + (execute_late_warn_uninitialized): Removed + * tree-flow.h: Add new prototypes. + * timevar.def: Add new time variable. + * Makefile.in: Add new build file. + 2010-04-28 Uros Bizjak * config/alpha/elf.h (ASM_DECLARE_OBJECT_NAME): Use gnu_unique_object diff --git a/gcc/Makefile.in b/gcc/Makefile.in index ca685700caa..d924f3ba790 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1385,6 +1385,7 @@ OBJS-common = \ tree-ssa-threadedge.o \ tree-ssa-threadupdate.o \ tree-ssa-uncprop.o \ + tree-ssa-uninit.o \ tree-ssa.o \ tree-ssanames.o \ tree-stdarg.o \ @@ -2288,6 +2289,12 @@ tree-ssa-structalias.o: tree-ssa-structalias.c \ $(GIMPLE_H) $(HASHTAB_H) $(FUNCTION_H) $(CGRAPH_H) \ $(TREE_PASS_H) $(TIMEVAR_H) alloc-pool.h $(SPLAY_TREE_H) $(PARAMS_H) \ gt-tree-ssa-structalias.h $(CGRAPH_H) $(ALIAS_H) pointer-set.h +tree-ssa-uninit.o : tree-ssa-uninit.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \ + $(TOPLEV_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) langhooks.h tree-pass.h $(BASIC_BLOCK_H) $(BITMAP_H) \ + $(FLAGS_H) $(GGC_H) hard-reg-set.h $(HASHTAB_H) pointer-set.h \ + $(GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) tree-ssa.o : tree-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \ $(TOPLEV_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1d1b6f1e1de..a35d126585c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,39 @@ +2010-04-28 Xinliang David Li + + * gcc.dg/uninit-pred-2_b.c: New test. + * gcc.dg/uninit-pred-4_b.c: New test. + * gcc.dg/uninit-pred-3_d.c: New test. + * gcc.dg/uninit-pred-6_b.c: New test. + * gcc.dg/uninit-pred-8_b.c: New test. + * gcc.dg/uninit-pred-3_a.c: New test. + * gcc.dg/uninit-pred-2_c.c: New test. + * gcc.dg/uninit-pred-5_a.c: New test. + * gcc.dg/uninit-pred-3_e.c: New test. + * gcc.dg/uninit-pred-7_a.c: New test. + * gcc.dg/uninit-pred-6_c.c: New test. + * gcc.dg/uninit-pred-9_a.c: New test. + * gcc.dg/uninit-pred-8_c.c: New test. + * gcc.dg/uninit-pred-3_b.c: New test. + * gcc.dg/uninit-pred-5_b.c: New test. + * gcc.dg/uninit-pred-7_b.c: New test. + * gcc.dg/uninit-pred-6_d.c: New test. + * gcc.dg/uninit-pred-9_b.c: New test. + * gcc.dg/uninit-pred-2_a.c: New test. + * gcc.dg/uninit-pred-4_a.c: New test. + * gcc.dg/uninit-pred-3_c.c: New test. + * gcc.dg/uninit-pred-6_a.c: New test. + * gcc.dg/uninit-pred-8_a.c: New test. + * gcc.dg/uninit-pred-7_c.c: New test. + * gcc.dg/uninit-pred-6_e.c: New test. + * g++.dg/uninit-pred-loop-1_b.cc: New test. + * g++.dg/uninit-pred-1_a.C: New test. + * g++.dg/uninit-pred-1_b.C: New test. + * g++.dg/uninit-pred-2_a.C: New test. + * g++.dg/uninit-pred-2_b.C: New test. + * g++.dg/uninit-pred-loop-1_a.cc: New test. + * g++.dg/uninit-pred-loop-1_c.cc: New test. + * g++.dg/uninit-pred-loop_1.cc: New test. + 2010-04-28 Martin Jambor * gcc.dg/lto/20091209-1_0.c: New testcase. diff --git a/gcc/testsuite/g++.dg/uninit-pred-1_b.C b/gcc/testsuite/g++.dg/uninit-pred-1_b.C index 94a444d21ef..0d5b71ec899 100644 --- a/gcc/testsuite/g++.dg/uninit-pred-1_b.C +++ b/gcc/testsuite/g++.dg/uninit-pred-1_b.C @@ -41,7 +41,7 @@ __attribute__ ((always_inline)) int GetC (int *c) { void P (int64 t) { - int cc; /* { dg-message "note: 'cc' was declared here" } */ + int cc; /* { dg-excess-errors "note: 'cc' was declared here" } */ if (GetC (&cc) <= 0 ) /* return flag checked wrongly */ return; diff --git a/gcc/testsuite/g++.dg/uninit-pred-2_b.C b/gcc/testsuite/g++.dg/uninit-pred-2_b.C index 5023fc50b6b..7259d8f95a4 100644 --- a/gcc/testsuite/g++.dg/uninit-pred-2_b.C +++ b/gcc/testsuite/g++.dg/uninit-pred-2_b.C @@ -40,7 +40,7 @@ __attribute__ ((always_inline)) bool GetC (int *c) { void P (int64 t) { - int cc; /* { dg-message "note: 'cc' was declared here" } */ + int cc; /* { dg-excess-errors "note" } */ if (GetC (&cc)) /* return flag checked wrongly */ return; diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c index 5487cc06b96..4f23962485f 100644 --- a/gcc/tree-ssa-uninit.c +++ b/gcc/tree-ssa-uninit.c @@ -1,5 +1,5 @@ /* Predicate aware uninitialized variable warning. - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010 Free Software + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Contributed by Xinliang David Li @@ -25,19 +25,22 @@ along with GCC; see the file COPYING3. If not see #include "tm.h" #include "tree.h" #include "flags.h" +#include "rtl.h" #include "tm_p.h" +#include "ggc.h" #include "langhooks.h" +#include "hard-reg-set.h" #include "basic-block.h" #include "output.h" #include "expr.h" #include "function.h" #include "diagnostic.h" -#include "gimple-pretty-print.h" #include "bitmap.h" #include "pointer-set.h" #include "tree-flow.h" #include "gimple.h" #include "tree-inline.h" +#include "varray.h" #include "timevar.h" #include "hashtab.h" #include "tree-dump.h"