Commit 80661759 by Richard Kenner Committed by Richard Kenner

alias.c (get_alias_set): If compnent is addressable, use alias set of component.

	* alias.c (get_alias_set): If compnent is addressable, use alias
	set of component.
	* c-decl.c (init_decl_processing): Don't call record_component_aliases.
	(grokdeclarator): Likewise.
	* c-typeck.c (common_type): Likewise.
	* cp/decl.c (init_decl_processing): Don't call
	record_component_aliases.
	* cp/tree.c (build_cplus_array_type_1): Likewise.

From-SVN: r34400
parent 137e9760
Mon Jun 5 06:46:28 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* alias.c (get_alias_set): If compnent is addressable, use alias
set of component.
* c-decl.c (init_decl_processing): Don't call record_component_aliases.
(grokdeclarator): Likewise.
* c-typeck.c (common_type): Likewise.
2000-06-04 Alex Samuel <samuel@codesourcery.com> 2000-06-04 Alex Samuel <samuel@codesourcery.com>
* Makefile.in (OBJS): Remove dyn_string.o * Makefile.in (OBJS): Remove dyn_string.o
......
...@@ -344,11 +344,6 @@ get_alias_set (t) ...@@ -344,11 +344,6 @@ get_alias_set (t)
{ {
tree orig_t; tree orig_t;
HOST_WIDE_INT set; HOST_WIDE_INT set;
HOST_WIDE_INT bitsize, bitpos;
tree offset;
enum machine_mode mode;
int volatilep, unsignedp;
unsigned int alignment;
/* If we're not doing any alias analysis, just assume everything /* If we're not doing any alias analysis, just assume everything
aliases everything else. Also return 0 if this or its type is aliases everything else. Also return 0 if this or its type is
...@@ -376,12 +371,38 @@ get_alias_set (t) ...@@ -376,12 +371,38 @@ get_alias_set (t)
if ((set = lang_get_alias_set (t)) != -1) if ((set = lang_get_alias_set (t)) != -1)
return set; return set;
/* If this is a reference, go inside it and use the underlying /* Now loop the same way as get_inner_reference and get the alias
object. */ set to use. Pick up the outermost object that we could have
if (TREE_CODE_CLASS (TREE_CODE (t)) == 'r') a pointer to. */
t = get_inner_reference (t, &bitsize, &bitpos, &offset, &mode, while (1)
&unsignedp, &volatilep, &alignment); {
/* Unnamed bitfields are not an addressable object. */
if (TREE_CODE (t) == BIT_FIELD_REF)
;
else if (TREE_CODE (t) == COMPONENT_REF)
{
if (! DECL_NONADDRESSABLE_P (TREE_OPERAND (t, 1)))
/* Stop at an adressable decl. */
break;
}
else if (TREE_CODE (t) == ARRAY_REF)
{
if (! TYPE_NONALIASED_COMPONENT
(TREE_TYPE (TREE_OPERAND (t, 0))))
/* Stop at an addresssable array element. */
break;
}
else if (TREE_CODE (t) != NON_LVALUE_EXPR
&& ! ((TREE_CODE (t) == NOP_EXPR
|| TREE_CODE (t) == CONVERT_EXPR)
&& (TYPE_MODE (TREE_TYPE (t))
== TYPE_MODE (TREE_TYPE (TREE_OPERAND (t, 0))))))
/* Stop if not one of above and not mode-preserving conversion. */
break;
t = TREE_OPERAND (t, 0);
}
if (TREE_CODE (t) == INDIRECT_REF) if (TREE_CODE (t) == INDIRECT_REF)
{ {
/* Check for accesses through restrict-qualified pointers. */ /* Check for accesses through restrict-qualified pointers. */
......
...@@ -3023,10 +3023,6 @@ init_decl_processing () ...@@ -3023,10 +3023,6 @@ init_decl_processing ()
wchar_array_type_node wchar_array_type_node
= build_array_type (wchar_type_node, array_domain_type); = build_array_type (wchar_type_node, array_domain_type);
record_component_aliases (char_array_type_node);
record_component_aliases (int_array_type_node);
record_component_aliases (wchar_array_type_node);
void_list_node = tree_cons (NULL_TREE, void_type_node, NULL_TREE); void_list_node = tree_cons (NULL_TREE, void_type_node, NULL_TREE);
default_function_type default_function_type
...@@ -4405,7 +4401,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) ...@@ -4405,7 +4401,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
type = build_array_type (type, itype); type = build_array_type (type, itype);
if (type_quals) if (type_quals)
type = c_build_qualified_type (type, type_quals); type = c_build_qualified_type (type, type_quals);
record_component_aliases (type);
#if 0 /* don't clear these; leave them set so that the array type #if 0 /* don't clear these; leave them set so that the array type
or the variable is itself const or volatile. */ or the variable is itself const or volatile. */
...@@ -4578,7 +4573,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) ...@@ -4578,7 +4573,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
&& TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == 0) && TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == 0)
{ {
type = build_array_type (TREE_TYPE (type), 0); type = build_array_type (TREE_TYPE (type), 0);
record_component_aliases (type);
if (size_varies) if (size_varies)
C_TYPE_VARIABLE_SIZE (type) = 1; C_TYPE_VARIABLE_SIZE (type) = 1;
} }
...@@ -4691,7 +4685,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) ...@@ -4691,7 +4685,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
type = build_array_type (c_build_qualified_type (TREE_TYPE (type), type = build_array_type (c_build_qualified_type (TREE_TYPE (type),
type_quals), type_quals),
TYPE_DOMAIN (type)); TYPE_DOMAIN (type));
record_component_aliases (type);
#if 0 /* Leave the field const or volatile as well. */ #if 0 /* Leave the field const or volatile as well. */
type_quals = TYPE_UNQUALIFIED; type_quals = TYPE_UNQUALIFIED;
#endif #endif
...@@ -4774,7 +4767,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) ...@@ -4774,7 +4767,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
type = build_array_type (c_build_qualified_type (TREE_TYPE (type), type = build_array_type (c_build_qualified_type (TREE_TYPE (type),
type_quals), type_quals),
TYPE_DOMAIN (type)); TYPE_DOMAIN (type));
record_component_aliases (type);
#if 0 /* Leave the variable const or volatile as well. */ #if 0 /* Leave the variable const or volatile as well. */
type_quals = TYPE_UNQUALIFIED; type_quals = TYPE_UNQUALIFIED;
#endif #endif
......
...@@ -313,7 +313,6 @@ common_type (t1, t2) ...@@ -313,7 +313,6 @@ common_type (t1, t2)
return build_type_attribute_variant (t2, attributes); return build_type_attribute_variant (t2, attributes);
/* Merge the element types, and have a size if either arg has one. */ /* Merge the element types, and have a size if either arg has one. */
t1 = build_array_type (elt, TYPE_DOMAIN (TYPE_DOMAIN (t1) ? t1 : t2)); t1 = build_array_type (elt, TYPE_DOMAIN (TYPE_DOMAIN (t1) ? t1 : t2));
record_component_aliases (t1);
return build_type_attribute_variant (t1, attributes); return build_type_attribute_variant (t1, attributes);
} }
......
Mon Jun 5 06:48:55 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* decl.c (init_decl_processing): Don't call record_component_aliases.
* tree.c (build_cplus_array_type_1): Likewise.
2000-06-04 Mark Mitchell <mark@codesourcery.com> 2000-06-04 Mark Mitchell <mark@codesourcery.com>
* ir.texi: Correct typo. * ir.texi: Correct typo.
......
...@@ -6478,9 +6478,6 @@ init_decl_processing () ...@@ -6478,9 +6478,6 @@ init_decl_processing ()
int_array_type_node int_array_type_node
= build_array_type (integer_type_node, array_domain_type); = build_array_type (integer_type_node, array_domain_type);
record_component_aliases (char_array_type_node);
record_component_aliases (int_array_type_node);
if (flag_new_abi) if (flag_new_abi)
delta_type_node = ptrdiff_type_node; delta_type_node = ptrdiff_type_node;
else if (flag_huge_objects) else if (flag_huge_objects)
...@@ -6544,7 +6541,6 @@ init_decl_processing () ...@@ -6544,7 +6541,6 @@ init_decl_processing ()
/* This is for wide string constants. */ /* This is for wide string constants. */
wchar_array_type_node wchar_array_type_node
= build_array_type (wchar_type_node, array_domain_type); = build_array_type (wchar_type_node, array_domain_type);
record_component_aliases (wchar_array_type_node);
if (flag_vtable_thunks) if (flag_vtable_thunks)
{ {
......
...@@ -500,10 +500,7 @@ build_cplus_array_type_1 (elt_type, index_type) ...@@ -500,10 +500,7 @@ build_cplus_array_type_1 (elt_type, index_type)
TYPE_DOMAIN (t) = index_type; TYPE_DOMAIN (t) = index_type;
} }
else else
{ t = build_array_type (elt_type, index_type);
t = build_array_type (elt_type, index_type);
record_component_aliases (t);
}
/* Push these needs up so that initialization takes place /* Push these needs up so that initialization takes place
more easily. */ more easily. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment