OSDN Git Service

predicate aware uninitialized analysis
authordavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Apr 2010 17:41:31 +0000 (17:41 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 04:53:57 +0000 (13:53 +0900)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158835 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/Makefile.in
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/uninit-pred-1_b.C
gcc/testsuite/g++.dg/uninit-pred-2_b.C
gcc/tree-ssa-uninit.c

index 6e41853..c84d857 100644 (file)
@@ -1,3 +1,49 @@
+2010-04-28  Xinliang David Li  <davidxl@google.com>
+
+       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  <ubizjak@gmail.com>
 
        * config/alpha/elf.h (ASM_DECLARE_OBJECT_NAME): Use gnu_unique_object
index ca68570..d924f3b 100644 (file)
@@ -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 \
index 1d1b6f1..a35d126 100644 (file)
@@ -1,3 +1,39 @@
+2010-04-28  Xinliang David Li  <davidxl@google.com>
+
+       * 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  <mjambor@suse.cz>
 
        * gcc.dg/lto/20091209-1_0.c: New testcase.
index 94a444d..0d5b71e 100644 (file)
@@ -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;
       
index 5023fc5..7259d8f 100644 (file)
@@ -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;
       
index 5487cc0..4f23962 100644 (file)
@@ -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 <davidxl@google.com>
 
@@ -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"