aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-03-12 20:00:32 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-03-12 20:00:32 +0000
commit2b45154d2074a11baa2dfa18247848227fbfa1f0 (patch)
tree1b26a4183158628e3053e92f393f5fa662df3146 /gcc/ada/gcc-interface/trans.c
parent0452b4d47fe1e13bbcb8578e7e348cef2ca17e42 (diff)
downloadgcc-2b45154d2074a11baa2dfa18247848227fbfa1f0.zip
gcc-2b45154d2074a11baa2dfa18247848227fbfa1f0.tar.gz
gcc-2b45154d2074a11baa2dfa18247848227fbfa1f0.tar.bz2
gigi.h (shift_unc_components_for_thin_pointers): Kill.
* gcc-interface/gigi.h (shift_unc_components_for_thin_pointers): Kill. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Remove call to above function. * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Pool_Address>: Adjust handling of thin pointers. <Attr_Descriptor_Size>: Likewise. (gnat_to_gnu) <N_Free_Statement>: Likewise. * gcc-interface/utils.c (shift_unc_components_for_thin_pointers): Kill. (convert_to_fat_pointer): Adjust handling of thin pointers. (convert) <POINTER_TYPE>: Likewise. * gcc-interface/utils2.c (build_unary_op) <INDIRECT_REF>: Likewise. From-SVN: r185268
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index cd6626f..89f5438 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -1439,7 +1439,10 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
gnu_ptr
= build_binary_op (POINTER_PLUS_EXPR, TREE_TYPE (gnu_ptr),
gnu_ptr,
- byte_position (TYPE_FIELDS (gnu_obj_type)));
+ fold_build1 (NEGATE_EXPR, sizetype,
+ byte_position
+ (DECL_CHAIN
+ TYPE_FIELDS ((gnu_obj_type)))));
gnu_result = convert (gnu_result_type, gnu_ptr);
}
@@ -1950,12 +1953,10 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
gnu_type = TREE_TYPE (gnu_prefix);
gcc_assert (TREE_CODE (gnu_type) == UNCONSTRAINED_ARRAY_TYPE);
- /* What we want is the offset of the ARRAY field in the record that the
- thin pointer designates, but the components have been shifted so this
- is actually the opposite of the offset of the BOUNDS field. */
+ /* What we want is the offset of the ARRAY field in the record
+ that the thin pointer designates. */
gnu_type = TYPE_OBJECT_RECORD_TYPE (gnu_type);
- gnu_result = size_binop (MINUS_EXPR, bitsize_zero_node,
- bit_position (TYPE_FIELDS (gnu_type)));
+ gnu_result = bit_position (DECL_CHAIN (TYPE_FIELDS (gnu_type)));
gnu_result_type = get_unpadded_type (Etype (gnat_node));
prefix_unused = true;
break;
@@ -6622,7 +6623,10 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_ptr
= build_binary_op (POINTER_PLUS_EXPR, TREE_TYPE (gnu_ptr),
gnu_ptr,
- byte_position (TYPE_FIELDS (gnu_obj_type)));
+ fold_build1 (NEGATE_EXPR, sizetype,
+ byte_position
+ (DECL_CHAIN
+ TYPE_FIELDS ((gnu_obj_type)))));
/* If we have a special dynamic constrained subtype on the node, use
it to compute the size; otherwise, use the designated subtype. */