not vice versa. For example, in C, a store to an `int' can alias a
structure containing an `int', but not vice versa. Here, the
structure would be the SUPERSET and `int' the SUBSET. This
- function should be called only once per SUPERSET/SUBSET pair. At
- present any given alias set may only be a subset of one superset.
+ function should be called only once per SUPERSET/SUBSET pair.
It is illegal for SUPERSET to be zero; everything is implicitly a
subset of alias set zero. */
(splay_tree_key) subset, 0);
}
+/* Record that component types of TYPE, if any, are part of that type for
+ aliasing purposes. For record types, we only record component types
+ for fields that are marked addressable. For array types, we always
+ record the component types, so the front end should not call this
+ function if the individual component aren't addressable. */
+
+void
+record_component_aliases (type)
+ tree type;
+{
+ int superset = get_alias_set (type);
+ int subset;
+ tree field;
+
+ if (superset == 0)
+ return;
+
+ switch (TREE_CODE (type))
+ {
+ case ARRAY_TYPE:
+ case COMPLEX_TYPE:
+ subset = get_alias_set (TREE_TYPE (type));
+ if (subset != 0)
+ record_alias_subset (superset, subset);
+ break;
+
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case QUAL_UNION_TYPE:
+ for (field = TYPE_FIELDS (type); field != 0; field = TREE_CHAIN (field))
+ {
+ subset = get_alias_set (TREE_TYPE (field));
+ if (TREE_ADDRESSABLE (field) && subset != 0 && subset != superset)
+ record_alias_subset (superset, subset);
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
/* Inside SRC, the source of a SET, find a base address. */
static rtx
get_alias_set (t)
tree t;
{
+ /* If we're not doing any lanaguage-specific alias analysis, just
+ assume everything aliases everything else. */
if (! flag_strict_aliasing || lang_get_alias_set == 0)
- /* If we're not doing any lanaguage-specific alias analysis, just
- assume everything aliases everything else. */
return 0;
+
+ /* If this is a type with a known alias set, return it since this must
+ be the correct thing to do. */
+ else if (TYPE_P (t) && TYPE_ALIAS_SET_KNOWN_P (t))
+ return TYPE_ALIAS_SET (t);
else
return (*lang_get_alias_set) (t);
}
extern void push_obstacks_nochange PARAMS ((void));
extern void permanent_allocation PARAMS ((int));
-
extern void push_momentary PARAMS ((void));
-
extern void clear_momentary PARAMS ((void));
-
extern void pop_momentary PARAMS ((void));
-
extern void end_temporary_allocation PARAMS ((void));
/* Pop the obstack selection stack. */
extern void pop_obstacks PARAMS ((void));
+/* In alias.c */
+void record_component_aliases PARAMS ((tree));
+
/* In tree.c */
extern int really_constant_p PARAMS ((tree));
extern void push_obstacks PARAMS ((struct obstack *,
extern void print_obstack_statistics PARAMS ((const char *,
struct obstack *));
#ifdef BUFSIZ
-extern void print_obstack_name PARAMS ((char *, FILE *, const char *));
+extern void print_obstack_name PARAMS ((char *, FILE *,
+ const char *));
#endif
extern void expand_function_end PARAMS ((const char *, int, int));
extern void expand_function_start PARAMS ((tree, int));
+
extern int real_onep PARAMS ((tree));
extern int real_twop PARAMS ((tree));
extern void start_identifier_warnings PARAMS ((void));
/* In print-tree.c */
extern void debug_tree PARAMS ((tree));
#ifdef BUFSIZ
-extern void print_node PARAMS ((FILE *, const char *, tree, int));
-extern void print_node_brief PARAMS ((FILE *, const char *, tree, int));
+extern void print_node PARAMS ((FILE *, const char *, tree,
+ int));
+extern void print_node_brief PARAMS ((FILE *, const char *, tree,
+ int));
extern void indent_to PARAMS ((FILE *, int));
#endif
extern struct rtx_def *expand_builtin_return_addr
PARAMS ((enum built_in_function, int, struct rtx_def *));
extern void do_pending_stack_adjust PARAMS ((void));
-extern struct rtx_def *expand_assignment PARAMS ((tree, tree, int, int));
-extern struct rtx_def *store_expr PARAMS ((tree, struct rtx_def *,
+extern struct rtx_def *expand_assignment PARAMS ((tree, tree, int,
+ int));
+extern struct rtx_def *store_expr PARAMS ((tree,
+ struct rtx_def *,
int));
extern void check_max_integer_computation_mode PARAMS ((tree));
/* In calls.c */
-/* Flags used by special_function_p. */
extern int setjmp_call_p PARAMS ((tree));
-/* In c-typeck.c */
+/* In front end. */
+
extern int mark_addressable PARAMS ((tree));
extern void incomplete_type_error PARAMS ((tree, tree));
-
-/* In c-lang.c */
extern void print_lang_statistics PARAMS ((void));
-
-/* In c-common.c */
extern tree truthvalue_conversion PARAMS ((tree));
extern void split_specs_attrs PARAMS ((tree, tree *, tree *));
-
-/* In c-decl.c */
#ifdef BUFSIZ
extern void print_lang_decl PARAMS ((FILE *, tree, int));
extern void print_lang_type PARAMS ((FILE *, tree, int));
extern void output_inline_function PARAMS ((tree));
extern void set_decl_origin_self PARAMS ((tree));
-/* In c-lex.c */
+/* In front end. */
extern void set_yydebug PARAMS ((int));
/* In stor-layout.c */