diff options
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/Makefile.in | 6 | ||||
-rw-r--r-- | gcc/cgraphunit.c | 1 | ||||
-rw-r--r-- | gcc/omp-low.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c | 2 | ||||
-rw-r--r-- | gcc/tree-dfa.c | 47 | ||||
-rw-r--r-- | gcc/tree-flow.h | 1 | ||||
-rw-r--r-- | gcc/tree-ssa-pre.c | 1 |
9 files changed, 56 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a1c1a78e70..985926f8b0c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2009-04-17 Diego Novillo <dnovillo@google.com> + + * omp-low.c (create_omp_child_function): Set DECL_CONTEXT + for DECL. + * cgraphunit.c (cgraph_build_static_cdtor): Likewise. + * tree-dfa.c (find_referenced_vars_in): Factor out of ... + (find_vars_r): ... here. + * tree-flow.h (find_referenced_vars_in): Declare. + * tree-ssa-pre.c (create_expression_by_pieces): Assert + that AVAIL_OUT exists for BLOCK. + * Makefile.in (CGRAPH_H): Add dependency on cif-code.def + (tree-loop-distribution.o): Fix dependency on TREE_VECTORIZER_H. + (tree-parloops.o): Likewise. + 2009-04-17 Simon Baldwin <simonb@google.com> * toplev.c (default_tree_printer): Add handling for %E format. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 43532b0cd4b..91a2c92df7e 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -832,7 +832,7 @@ CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) $(RTL_H) vecprim.h double-int.h IPA_UTILS_H = ipa-utils.h $(TREE_H) $(CGRAPH_H) IPA_REFERENCE_H = ipa-reference.h $(BITMAP_H) $(TREE_H) IPA_TYPE_ESCAPE_H = ipa-type-escape.h $(TREE_H) -CGRAPH_H = cgraph.h $(TREE_H) $(BASIC_BLOCK_H) +CGRAPH_H = cgraph.h $(TREE_H) $(BASIC_BLOCK_H) cif-code.def DF_H = df.h $(BITMAP_H) $(BASIC_BLOCK_H) alloc-pool.h $(TIMEVAR_H) RESOURCE_H = resource.h hard-reg-set.h $(DF_H) DDG_H = ddg.h sbitmap.h $(DF_H) @@ -2399,11 +2399,11 @@ tree-loop-distribution.o: tree-loop-distribution.c $(CONFIG_H) $(SYSTEM_H) coret $(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ $(TREE_PASS_H) $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) \ - $(TARGET_H) tree-chrec.h langhooks.h tree-vectorizer.h + $(TARGET_H) tree-chrec.h langhooks.h $(TREE_VECTORIZER_H) tree-parloops.o: tree-parloops.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_FLOW_H) $(TREE_H) $(RTL_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(GGC_H) \ $(DIAGNOSTIC_H) $(TREE_PASS_H) $(SCEV_H) langhooks.h gt-tree-parloops.h \ - tree-vectorizer.h + $(TREE_VECTORIZER_H) tree-stdarg.o: tree-stdarg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) $(FUNCTION_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_PASS_H) \ tree-stdarg.h $(TARGET_H) langhooks.h diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 9f6a50ddcbe..859eaddfc6e 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1369,6 +1369,7 @@ cgraph_build_static_cdtor (char which, tree body, int priority) resdecl = build_decl (RESULT_DECL, NULL_TREE, void_type_node); DECL_ARTIFICIAL (resdecl) = 1; DECL_RESULT (decl) = resdecl; + DECL_CONTEXT (resdecl) = decl; allocate_struct_function (decl, false); diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 3b99f69b62a..3e6d91cc592 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -1577,6 +1577,7 @@ create_omp_child_function (omp_context *ctx, bool task_copy) t = build_decl (RESULT_DECL, NULL_TREE, void_type_node); DECL_ARTIFICIAL (t) = 1; DECL_IGNORED_P (t) = 1; + DECL_CONTEXT (t) = decl; DECL_RESULT (decl) = t; t = build_decl (PARM_DECL, get_identifier (".omp_data_i"), ptr_type_node); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 94c5efdd010..c4269123182 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-04-17 Diego Novillo <dnovillo@google.com> + + * gcc.c-torture/execute/builtins/strlen-3.c: Fix ODR + violation for variable 'inside_main'. + 2009-04-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> * gfortran.fortran-torture/execute/getarg_1.x: New file. diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c b/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c index 221e306247a..666ca21b94f 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c @@ -10,7 +10,7 @@ extern char *strcpy (char *, const char *); static const char bar[] = "Hello, World!"; static const char baz[] = "hello, world?"; static const char larger[20] = "short string"; -extern volatile int inside_main; +extern int inside_main; int l1 = 1; int x = 6; diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 1738dd01266..1bd54cd99a3 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -88,26 +88,10 @@ find_referenced_vars (void) FOR_EACH_BB (bb) { for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si)) - { - size_t i; - gimple stmt = gsi_stmt (si); - for (i = 0; i < gimple_num_ops (stmt); i++) - walk_tree (gimple_op_ptr (stmt, i), find_vars_r, NULL, NULL); - } + find_referenced_vars_in (gsi_stmt (si)); for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si)) - { - gimple phi = gsi_stmt (si); - size_t i, len = gimple_phi_num_args (phi); - - walk_tree (gimple_phi_result_ptr (phi), find_vars_r, NULL, NULL); - - for (i = 0; i < len; i++) - { - tree arg = gimple_phi_arg_def (phi, i); - walk_tree (&arg, find_vars_r, NULL, NULL); - } - } + find_referenced_vars_in (gsi_stmt (si)); } return 0; @@ -498,6 +482,33 @@ find_vars_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) return NULL_TREE; } +/* Find referenced variables in STMT. In contrast with + find_new_referenced_vars, this function will not mark newly found + variables for renaming. */ + +void +find_referenced_vars_in (gimple stmt) +{ + size_t i; + + if (gimple_code (stmt) != GIMPLE_PHI) + { + for (i = 0; i < gimple_num_ops (stmt); i++) + walk_tree (gimple_op_ptr (stmt, i), find_vars_r, NULL, NULL); + } + else + { + walk_tree (gimple_phi_result_ptr (stmt), find_vars_r, NULL, NULL); + + for (i = 0; i < gimple_phi_num_args (stmt); i++) + { + tree arg = gimple_phi_arg_def (stmt, i); + walk_tree (&arg, find_vars_r, NULL, NULL); + } + } +} + + /* Lookup UID in the referenced_vars hashtable and return the associated variable. */ diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index f2d7c5f7f93..d78baf45923 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -616,6 +616,7 @@ extern tree gimple_default_def (struct function *, tree); extern bool stmt_references_abnormal_ssa_name (gimple); extern tree get_ref_base_and_extent (tree, HOST_WIDE_INT *, HOST_WIDE_INT *, HOST_WIDE_INT *); +extern void find_referenced_vars_in (gimple); /* In tree-phinodes.c */ extern void reserve_phi_args_for_new_edge (basic_block); diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 61207b2f849..f63124fe570 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -3003,6 +3003,7 @@ create_expression_by_pieces (basic_block block, pre_expr expr, add_to_value (VN_INFO (forcedname)->value_id, nameexpr); if (!in_fre) bitmap_value_replace_in_set (NEW_SETS (block), nameexpr); + gcc_assert (AVAIL_OUT (block)); bitmap_value_replace_in_set (AVAIL_OUT (block), nameexpr); } mark_symbols_for_renaming (stmt); |