diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 31 | ||||
-rw-r--r-- | gcc/tree-dfa.c | 19 | ||||
-rw-r--r-- | gcc/tree-flow-inline.h | 16 | ||||
-rw-r--r-- | gcc/tree-flow.h | 7 | ||||
-rw-r--r-- | gcc/tree-ssa-pre.c | 8 | ||||
-rw-r--r-- | gcc/tree-vect-patterns.c | 2 | ||||
-rw-r--r-- | gcc/tree-vect-transform.c | 4 | ||||
-rw-r--r-- | gcc/tree-vectorizer.c | 8 | ||||
-rw-r--r-- | gcc/tree-vectorizer.h | 6 | ||||
-rw-r--r-- | gcc/tree-vn.c | 6 |
10 files changed, 69 insertions, 38 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index edd15d9b7ba..5d66902f67f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,34 @@ +2006-09-12 Jan Hubicka <jh@suse.cz> + + PR rtl-optimization/28071 + * tree-vect-transform.c (vect_create_data_ref_ptr): Kill cast. + (vect_transform_loop): Likewise. + * tree-vectorizer.c (new_loop_vec_info): Likewise. + (new_loop_vec_info): Likewise. + (destroy_loop_vec_info): Likewise. + * tree-dfa.c (create_var_ann): Use GCC_CNEW. + (create_stmt_ann): Likewise. + (create_tree_ann): Rename to ... + (create_tree_common_ann): ... this one; allocate only the common part + of annotations. + * tree-vn.c (set_value_handle): Use get_tree_common_ann. + (get_value_handle): Likewise. + * tree-ssa-pre.c (phi_translate): Delay annotation allocation for + get_tree_common_ann. + * tree-vectorizer.h (set_stmt_info): Take stmt annotation. + (vinfo_for_stmt): Use stmt annotations. + * tree-flow.h (tree_ann_common_t): New type. + (tree_common_ann, get_tree_common_ann, create_tree_common_ann): New. + (tree_ann, get_tree_ann, create_tree_ann): New. + * tree-flow-inline.h (get_function_ann): Do more type checking. + (stmt_ann): Likewise. + (tree_ann): Rename to ... + (tree_common_ann): ... this one; return ony common_ann + (get_tree_ann): Rename to ... + (tree_common_ann): This one; return only common_ann. + * tree-vect-patterns.c (vect_pattern_recog_1): Update call + of set_stmt_info. + 2006-09-11 Geoffrey Keating <geoffk@apple.com> * config.gcc (i[34567]86-*-darwin*): Set with_arch and diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index f0049edeec2..088c45ab335 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -142,8 +142,7 @@ create_var_ann (tree t) gcc_assert (DECL_P (t)); gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN); - ann = GGC_NEW (struct var_ann_d); - memset ((void *) ann, 0, sizeof (*ann)); + ann = GGC_CNEW (struct var_ann_d); ann->common.type = VAR_ANN; @@ -183,8 +182,7 @@ create_stmt_ann (tree t) gcc_assert (is_gimple_stmt (t)); gcc_assert (!t->common.ann || t->common.ann->common.type == STMT_ANN); - ann = GGC_NEW (struct stmt_ann_d); - memset ((void *) ann, 0, sizeof (*ann)); + ann = GGC_CNEW (struct stmt_ann_d); ann->common.type = STMT_ANN; @@ -198,19 +196,18 @@ create_stmt_ann (tree t) /* Create a new annotation for a tree T. */ -tree_ann_t -create_tree_ann (tree t) +tree_ann_common_t +create_tree_common_ann (tree t) { - tree_ann_t ann; + tree_ann_common_t ann; gcc_assert (t); gcc_assert (!t->common.ann || t->common.ann->common.type == TREE_ANN_COMMON); - ann = GGC_NEW (union tree_ann_d); - memset ((void *) ann, 0, sizeof (*ann)); + ann = GGC_CNEW (struct tree_ann_common_d); - ann->common.type = TREE_ANN_COMMON; - t->common.ann = ann; + ann->type = TREE_ANN_COMMON; + t->common.ann = (tree_ann_t) ann; return ann; } diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h index 5f7efa7de31..892be56a61c 100644 --- a/gcc/tree-flow-inline.h +++ b/gcc/tree-flow-inline.h @@ -159,6 +159,7 @@ static inline function_ann_t get_function_ann (tree var) { function_ann_t ann = function_ann (var); + gcc_assert (!var->common.ann || var->common.ann->common.type == FUNCTION_ANN); return (ann) ? ann : create_function_ann (var); } @@ -170,6 +171,7 @@ stmt_ann (tree t) #ifdef ENABLE_CHECKING gcc_assert (is_gimple_stmt (t)); #endif + gcc_assert (!t->common.ann || t->common.ann->common.type == STMT_ANN); return (stmt_ann_t) t->common.ann; } @@ -785,19 +787,19 @@ mark_non_addressable (tree var) /* Return the common annotation for T. Return NULL if the annotation doesn't already exist. */ -static inline tree_ann_t -tree_ann (tree t) +static inline tree_ann_common_t +tree_common_ann (tree t) { - return t->common.ann; + return &t->common.ann->common; } /* Return a common annotation for T. Create the constant annotation if it doesn't exist. */ -static inline tree_ann_t -get_tree_ann (tree t) +static inline tree_ann_common_t +get_tree_common_ann (tree t) { - tree_ann_t ann = tree_ann (t); - return (ann) ? ann : create_tree_ann (t); + tree_ann_common_t ann = tree_common_ann (t); + return (ann) ? ann : create_tree_common_ann (t); } /* ----------------------------------------------------------------------- */ diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 5156bad0325..e8fa099f65d 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -332,9 +332,10 @@ typedef union tree_ann_d *tree_ann_t; typedef struct var_ann_d *var_ann_t; typedef struct function_ann_d *function_ann_t; typedef struct stmt_ann_d *stmt_ann_t; +typedef struct tree_ann_common_d *tree_ann_common_t; -static inline tree_ann_t tree_ann (tree); -static inline tree_ann_t get_tree_ann (tree); +static inline tree_ann_common_t tree_common_ann (tree); +static inline tree_ann_common_t get_tree_common_ann (tree); static inline var_ann_t var_ann (tree); static inline var_ann_t get_var_ann (tree); static inline function_ann_t function_ann (tree); @@ -623,7 +624,7 @@ extern void dump_generic_bb (FILE *, basic_block, int, int); extern var_ann_t create_var_ann (tree); extern function_ann_t create_function_ann (tree); extern stmt_ann_t create_stmt_ann (tree); -extern tree_ann_t create_tree_ann (tree); +extern tree_ann_common_t create_tree_common_ann (tree); extern void dump_dfa_stats (FILE *); extern void debug_dfa_stats (void); extern void debug_referenced_vars (void); diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index f1383b4e435..9c7b89faaf3 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -1151,7 +1151,7 @@ phi_translate (tree expr, value_set_t set, basic_block pred, TREE_OPERAND (newexpr, 0) = newop0 == oldop0 ? oldop0 : get_value_handle (newop0); TREE_OPERAND (newexpr, 1) = listchanged ? newarglist : oldarglist; TREE_OPERAND (newexpr, 2) = newop2 == oldop2 ? oldop2 : get_value_handle (newop2); - create_tree_ann (newexpr); + newexpr->common.ann = NULL; vn_lookup_or_add_with_vuses (newexpr, tvuses); expr = newexpr; phi_trans_add (oldexpr, newexpr, pred, tvuses); @@ -1260,7 +1260,7 @@ phi_translate (tree expr, value_set_t set, basic_block pred, } else { - create_tree_ann (newexpr); + newexpr->common.ann = NULL; vn_lookup_or_add_with_vuses (newexpr, newvuses); } expr = newexpr; @@ -1302,7 +1302,7 @@ phi_translate (tree expr, value_set_t set, basic_block pred, } else { - create_tree_ann (newexpr); + newexpr->common.ann = NULL; vn_lookup_or_add (newexpr, NULL); } expr = newexpr; @@ -1335,7 +1335,7 @@ phi_translate (tree expr, value_set_t set, basic_block pred, } else { - create_tree_ann (newexpr); + newexpr->common.ann = NULL; vn_lookup_or_add (newexpr, NULL); } expr = newexpr; diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index e73ea3b3878..9ac11b07bd3 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -522,7 +522,7 @@ vect_pattern_recog_1 ( SSA_NAME_DEF_STMT (var_name) = pattern_expr; bsi_insert_before (&si, pattern_expr, BSI_SAME_STMT); ann = stmt_ann (pattern_expr); - set_stmt_info ((tree_ann_t)ann, new_stmt_vec_info (pattern_expr, loop_vinfo)); + set_stmt_info (ann, new_stmt_vec_info (pattern_expr, loop_vinfo)); pattern_stmt_info = vinfo_for_stmt (pattern_expr); STMT_VINFO_RELATED_STMT (pattern_stmt_info) = stmt; diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index 33fdaf75746..14d3cc5e2d0 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -351,7 +351,7 @@ vect_create_data_ref_ptr (tree stmt, NULL_TREE, loop, &incr_bsi, insert_after, &indx_before_incr, &indx_after_incr); incr = bsi_stmt (incr_bsi); - set_stmt_info ((tree_ann_t)stmt_ann (incr), + set_stmt_info (stmt_ann (incr), new_stmt_vec_info (incr, loop_vinfo)); /* Copy the points-to information if it exists. */ @@ -3114,7 +3114,7 @@ vect_transform_loop (loop_vec_info loop_vinfo, /* Free the attached stmt_vec_info and remove the stmt. */ stmt_ann_t ann = stmt_ann (stmt); free (stmt_info); - set_stmt_info ((tree_ann_t)ann, NULL); + set_stmt_info (ann, NULL); bsi_remove (&si, true); continue; } diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index bfdac3bdfbb..8a361b7ad06 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -1401,7 +1401,7 @@ new_loop_vec_info (struct loop *loop) for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi)) { - tree_ann_t ann = get_tree_ann (phi); + stmt_ann_t ann = get_stmt_ann (phi); set_stmt_info (ann, new_stmt_vec_info (phi, res)); } @@ -1411,7 +1411,7 @@ new_loop_vec_info (struct loop *loop) stmt_ann_t ann; ann = stmt_ann (stmt); - set_stmt_info ((tree_ann_t)ann, new_stmt_vec_info (stmt, res)); + set_stmt_info (ann, new_stmt_vec_info (stmt, res)); } } @@ -1462,7 +1462,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo) for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi)) { - tree_ann_t ann = get_tree_ann (phi); + stmt_ann_t ann = stmt_ann (phi); stmt_info = vinfo_for_stmt (phi); free (stmt_info); @@ -1492,7 +1492,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo) /* Free stmt_vec_info. */ VEC_free (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmt_info)); free (stmt_info); - set_stmt_info ((tree_ann_t)ann, NULL); + set_stmt_info (ann, NULL); /* Remove dead "pattern stmts". */ if (remove_stmt_p) diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 3b7ca1b911a..536aae803ce 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -242,11 +242,11 @@ typedef struct _stmt_vec_info { #define STMT_VINFO_SAME_ALIGN_REFS(S) (S)->same_align_refs #define STMT_VINFO_DEF_TYPE(S) (S)->def_type -static inline void set_stmt_info (tree_ann_t ann, stmt_vec_info stmt_info); +static inline void set_stmt_info (stmt_ann_t ann, stmt_vec_info stmt_info); static inline stmt_vec_info vinfo_for_stmt (tree stmt); static inline void -set_stmt_info (tree_ann_t ann, stmt_vec_info stmt_info) +set_stmt_info (stmt_ann_t ann, stmt_vec_info stmt_info) { if (ann) ann->common.aux = (char *) stmt_info; @@ -255,7 +255,7 @@ set_stmt_info (tree_ann_t ann, stmt_vec_info stmt_info) static inline stmt_vec_info vinfo_for_stmt (tree stmt) { - tree_ann_t ann = tree_ann (stmt); + stmt_ann_t ann = stmt_ann (stmt); return ann ? (stmt_vec_info) ann->common.aux : NULL; } diff --git a/gcc/tree-vn.c b/gcc/tree-vn.c index 0bc5c0309df..3c88e5adc93 100644 --- a/gcc/tree-vn.c +++ b/gcc/tree-vn.c @@ -182,7 +182,7 @@ set_value_handle (tree e, tree v) SSA_NAME_VALUE (e) = v; else if (EXPR_P (e) || DECL_P (e) || TREE_CODE (e) == TREE_LIST || TREE_CODE (e) == CONSTRUCTOR) - get_tree_ann (e)->common.value_handle = v; + get_tree_common_ann (e)->value_handle = v; else /* Do nothing. Constants are their own value handles. */ gcc_assert (is_gimple_min_invariant (e)); @@ -438,8 +438,8 @@ get_value_handle (tree expr) else if (EXPR_P (expr) || DECL_P (expr) || TREE_CODE (expr) == TREE_LIST || TREE_CODE (expr) == CONSTRUCTOR) { - tree_ann_t ann = tree_ann (expr); - return ((ann) ? ann->common.value_handle : NULL_TREE); + tree_ann_common_t ann = tree_common_ann (expr); + return ((ann) ? ann->value_handle : NULL_TREE); } else gcc_unreachable (); |