aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-flow.h
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2005-03-13 00:46:07 +0000
committerDaniel Berlin <dberlin@gcc.gnu.org>2005-03-13 00:46:07 +0000
commitc75ab022811aa05c49657d6c48471962b48c9666 (patch)
tree03744f60b00db0493040ec2c836323945507bf16 /gcc/tree-flow.h
parent23845f022033163786a64dfef44b7c127b92c5bb (diff)
downloadgcc-c75ab022811aa05c49657d6c48471962b48c9666.zip
gcc-c75ab022811aa05c49657d6c48471962b48c9666.tar.gz
gcc-c75ab022811aa05c49657d6c48471962b48c9666.tar.bz2
In gcc/ada/ 2005-03-12 Daniel Berlin <dberlin@dberlin.org>
In gcc/ada/ 2005-03-12 Daniel Berlin <dberlin@dberlin.org> * misc.c (gnat_post_options): Turn off structural aliasing for now. In gcc/ 2005-03-12 Daniel Berlin <dberlin@dberlin.org> * tree-flow-inline.h (ref_contains_array_ref): New function. (lookup_subvars_for_var): Ditto. (get_subvars_for_var): Ditto. (var_can_have_subvars): Ditto. * tree-flow.h (mem_tag_kind): Add STRUCT_FIELD. (struct subvar): New type. * tree-dfa.c (okay_component_ref_for_subvars): New function. * tree-optimize.c (init_tree_optimization_passes): Call pass_create_structure_vars. * tree-ssa-alias.c: Include vec.h. (init_alias_info): Don't auto-clear call clobbered on struct-field tags. (compute_flow_insensitive_aliasing): Handle subvars. (group_aliases): Handle STRUCT_FIELD aliases. (setup_pointers_and_addressables): Ditto. Don't mark variables non-addressable if they still have addressable subvars. Also mark subvars addressable when the real variable is marked addressable. (add_pointed_to_var): Try to prune the pointed-to set by only pointing to subvars when possible. Otherwise, make sure we set addresses_needed and pt_vars to properly include subvars. (bitpos_of_field): New function. (push_fields_onto_fieldstack): Ditto. (get_or_create_used_part_for): Ditto. (create_overlap_variables_for): Ditto. (find_used_portions): Ditto. (create_structure_vars): Ditto. (pass_create_structure_vars): New structure. * tree-ssa-operands.c (finalize_ssa_v_must_defs): Remove assert. (get_expr_operands): Handle subvars. Also try to turn COMPONENT_REF accesses into must-defs now that we can accurately portray it. (note_addressable): Try to only mark as addressable those subvars we know a COMPONENT_REF touches. (overlap_subvar): New function. * tree-vect-analyze.c (vect_object_analysis): Add new parameter. Handle subvar storing. (vect_address_analysis): Update caller of vect_object_analysis. * tree-vect-transform.c (vect_create_data_ref_ptr): Copy subvars. * tree-vectorizer.h (struct _stmt_vec_info): Add subvars member. (STMT_VINFO_SUBVARS): New macro. * common.opts: add flag_tree_salias. * opts.c (decode_options): flag_tree_salias defaults to on. * doc/invoke.texi: Document fdump-tree-svars and -ftree-salias. * doc/tree-ssa.texi: Document structural alias analysis. From-SVN: r96362
Diffstat (limited to 'gcc/tree-flow.h')
-rw-r--r--gcc/tree-flow.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 479996d..25d3e5a 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -138,7 +138,26 @@ enum mem_tag_kind {
TYPE_TAG,
/* This variable is a name memory tag (NMT). */
- NAME_TAG
+ NAME_TAG,
+
+ /* This variable represents a structure field. */
+ STRUCT_FIELD
+};
+struct subvar;
+typedef struct subvar *subvar_t;
+
+/* This structure represents a fake sub-variable for a structure field. */
+
+struct subvar GTY(())
+{
+ /* Fake variable name */
+ tree var;
+ /* Offset inside structure. */
+ HOST_WIDE_INT offset;
+ /* Size of field. */
+ HOST_WIDE_INT size;
+ /* Next subvar for this structure. */
+ subvar_t next;
};
struct var_ann_d GTY(())
@@ -211,6 +230,8 @@ struct var_ann_d GTY(())
live at the same time and this can happen for each call to the
dominator optimizer. */
tree current_def;
+
+ subvar_t subvars;
};
@@ -556,6 +577,9 @@ extern tree make_rename_temp (tree, const char *);
extern void record_vars (tree);
extern bool block_may_fallthru (tree block);
+typedef tree tree_on_heap;
+DEF_VEC_MALLOC_P (tree_on_heap);
+
/* In tree-ssa-alias.c */
extern void dump_may_aliases_for (FILE *, tree);
extern void debug_may_aliases_for (tree);
@@ -567,13 +591,15 @@ extern void dump_points_to_info_for (FILE *, tree);
extern void debug_points_to_info_for (tree);
extern bool may_be_aliased (tree);
extern struct ptr_info_def *get_ptr_info (tree);
-
+static inline subvar_t get_subvars_for_var (tree);
+static inline bool ref_contains_array_ref (tree);
+extern tree okay_component_ref_for_subvars (tree, HOST_WIDE_INT *,
+ HOST_WIDE_INT *);
+static inline bool var_can_have_subvars (tree);
/* Call-back function for walk_use_def_chains(). At each reaching
definition, a function with this prototype is called. */
typedef bool (*walk_use_def_chains_fn) (tree, tree, void *);
-typedef tree tree_on_heap;
-DEF_VEC_MALLOC_P (tree_on_heap);
/* In tree-ssa.c */
extern void init_tree_ssa (void);