summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-23 20:43:44 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-23 20:43:44 +0000
commitb24423db5b258d251c2f58f447182ae03e1e4f4f (patch)
tree78c56d654a5d59c1b915116b930d92efc18f678e /gcc/ada
parent8548c4ad9777bf538d830b418f6457d7b7d4ccb1 (diff)
downloadgcc-b24423db5b258d251c2f58f447182ae03e1e4f4f.tar.gz
* alias.c (get_alias_set): Add support for TYPE_REF_CAN_ALIAS_ALL.
* c-common.c (handle_mode_attribute): Add extra arg to build_pointer_type_for_mode and build_reference_type_for_mode. * c-typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW for INTEGER_CST. * tree.c (build_pointer_type_for_mode): Add arg CAN_ALIAS_ALL. Chain pointers via TYPE_NEXT_PTR_TO. (build_reference_type_for_mode): Similarly. (build_type_no_quals): Add extra arg to build_pointer_type_for_mode and build_reference_type_for_mode. (tree_check4_failed): New function. * tree.h (TREE_CHECK4, PTR_OR_REF_CHECK): New macros. (TYPE_REF_CAN_ALIAS_ALL, TYPE_NEXT_PTR_TO, TYPE_NEXT_REF_TO): Likewise. (TREE_NO_UNSUED_WARNING, TREE_VIA_VIRTUAL, TREE_CONSTANT_OVERFLOW): Add check. * cp/typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW for INTEGER_CST. * ada/decl.c (gnat_to_gnu_entity, case E_Access_Type): Pass value of No_Strict_Aliasing to build_pointer_type_for_mode. * ada/utils.c (update_pointer_to): Walk pointer and ref chains. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79873 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/decl.c10
-rw-r--r--gcc/ada/utils.c36
3 files changed, 34 insertions, 18 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 986d55421a3..edb3e7b0a48 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * decl.c (gnat_to_gnu_entity, case E_Access_Type): Pass value
+ of No_Strict_Aliasing to build_pointer_type_for_mode.
+ * utils.c (update_pointer_to): Walk pointer and ref chains.
+
2004-03-22 Cyrille Comar <comar@act-europe.fr>
* ali.ads: Fix Comment about Dynamic_Elab.
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 458213e08b1..bb79af73be4 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -2929,8 +2929,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
}
else if (gnat_desig_type == gnat_entity)
{
- gnu_type = build_pointer_type_for_mode (make_node (VOID_TYPE),
- p_mode);
+ gnu_type
+ = build_pointer_type_for_mode (make_node (VOID_TYPE),
+ p_mode,
+ No_Strict_Aliasing (gnat_entity));
TREE_TYPE (gnu_type) = TYPE_POINTER_TO (gnu_type) = gnu_type;
}
else
@@ -2982,7 +2984,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
}
}
- gnu_type = build_pointer_type_for_mode (gnu_desig_type, p_mode);
+ gnu_type
+ = build_pointer_type_for_mode (gnu_desig_type, p_mode,
+ No_Strict_Aliasing (gnat_entity));
}
/* If we are not defining this object and we made a dummy pointer,
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index cd3f47c5b63..1c012fe9f3b 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -2665,24 +2665,30 @@ update_pointer_to (tree old_type, tree new_type)
/* Otherwise, first handle the simple case. */
if (TREE_CODE (new_type) != UNCONSTRAINED_ARRAY_TYPE)
{
- if (ptr != 0)
- TREE_TYPE (ptr) = new_type;
TYPE_POINTER_TO (new_type) = ptr;
-
- if (ref != 0)
- TREE_TYPE (ref) = new_type;
TYPE_REFERENCE_TO (new_type) = ref;
- if (ptr != 0 && TYPE_NAME (ptr) != 0
- && TREE_CODE (TYPE_NAME (ptr)) == TYPE_DECL
- && TREE_CODE (new_type) != ENUMERAL_TYPE)
- rest_of_decl_compilation (TYPE_NAME (ptr), NULL,
- global_bindings_p (), 0);
- if (ref != 0 && TYPE_NAME (ref) != 0
- && TREE_CODE (TYPE_NAME (ref)) == TYPE_DECL
- && TREE_CODE (new_type) != ENUMERAL_TYPE)
- rest_of_decl_compilation (TYPE_NAME (ref), NULL,
- global_bindings_p (), 0);
+ for (; ptr; ptr = TYPE_NEXT_PTR_TO (ptr))
+ {
+ TREE_TYPE (ptr) = new_type;
+
+ if (TYPE_NAME (ptr) != 0
+ && TREE_CODE (TYPE_NAME (ptr)) == TYPE_DECL
+ && TREE_CODE (new_type) != ENUMERAL_TYPE)
+ rest_of_decl_compilation (TYPE_NAME (ptr), NULL,
+ global_bindings_p (), 0);
+ }
+
+ for (; ref; ref = TYPE_NEXT_PTR_TO (ref))
+ {
+ TREE_TYPE (ref) = new_type;
+
+ if (TYPE_NAME (ref) != 0
+ && TREE_CODE (TYPE_NAME (ref)) == TYPE_DECL
+ && TREE_CODE (new_type) != ENUMERAL_TYPE)
+ rest_of_decl_compilation (TYPE_NAME (ref), NULL,
+ global_bindings_p (), 0);
+ }
}
/* Now deal with the unconstrained array case. In this case the "pointer"