From: ebotcazou Date: Tue, 13 Apr 2010 07:21:15 +0000 (+0000) Subject: * gcc-interface/gigi.h (standard_datatypes): Add ADT_parent_name_id. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=76b6f3492dad30d3a801cd85d0ab7b8016e6a837 * gcc-interface/gigi.h (standard_datatypes): Add ADT_parent_name_id. (parent_name_id): New macro. * gcc-interface/decl.c (gnat_to_gnu_entity) : Use it. * gcc-interface/trans.c (gigi): Initialize it. (lvalue_required_p) : New case. : Likewise. : Likewise. * gcc-interface/utils.c (convert): Try to properly upcast tagged types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158255 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 233c8b952fd..b62b913c4d4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,16 @@ 2010-04-13 Eric Botcazou + * gcc-interface/gigi.h (standard_datatypes): Add ADT_parent_name_id. + (parent_name_id): New macro. + * gcc-interface/decl.c (gnat_to_gnu_entity) : Use it. + * gcc-interface/trans.c (gigi): Initialize it. + (lvalue_required_p) : New case. + : Likewise. + : Likewise. + * gcc-interface/utils.c (convert): Try to properly upcast tagged types. + +2010-04-13 Eric Botcazou + * gcc-interface/ada-tree.h (TYPE_BY_REFERENCE_P): Delete. (DECL_CONST_ADDRESS_P): New macro. (SET_DECL_ORIGINAL_FIELD_TO_FIELD): Likewise. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 3a6ed260758..330adee8bdd 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -2855,7 +2855,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* ...and reference the _Parent field of this record. */ gnu_field = create_field_decl (parent_name_id, - gnu_parent, gnu_type, + gnu_parent, gnu_type, 0, has_rep ? TYPE_SIZE (gnu_parent) : NULL_TREE, has_rep diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index a4af50b68ab..b2b568659e3 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -349,9 +349,6 @@ enum standard_datatypes /* Identifier for the name of the _Parent field in tagged record types. */ ADT_parent_name_id, - /* Identifier for the name of the Exception_Data type. */ - ADT_exception_data_name_id, - /* Types and decls used by our temporary exception mechanism. See init_gigi_decls for details. */ ADT_jmpbuf_type, @@ -386,7 +383,6 @@ extern GTY(()) tree gnat_raise_decls[(int) LAST_REASON_CODE + 1]; #define free_decl gnat_std_decls[(int) ADT_free_decl] #define mulv64_decl gnat_std_decls[(int) ADT_mulv64_decl] #define parent_name_id gnat_std_decls[(int) ADT_parent_name_id] -#define exception_data_name_id gnat_std_decls[(int) ADT_exception_data_name_id] #define jmpbuf_type gnat_std_decls[(int) ADT_jmpbuf_type] #define jmpbuf_ptr_type gnat_std_decls[(int) ADT_jmpbuf_ptr_type] #define get_jmpbuf_decl gnat_std_decls[(int) ADT_get_jmpbuf_decl] diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 88d4047a87a..34cb88a3656 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -401,10 +401,6 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED, /* Name of the _Parent field in tagged record types. */ parent_name_id = get_identifier (Get_Name_String (Name_uParent)); - /* Name of the Exception_Data type defined in System.Standard_Library. */ - exception_data_name_id - = get_identifier ("system__standard_library__exception_data"); - /* Make the types and functions used for exception processing. */ jmpbuf_type = build_array_type (gnat_type_for_mode (Pmode, 0), @@ -821,12 +817,16 @@ lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant, /* ... fall through ... */ case N_Unchecked_Type_Conversion: - /* Returning 0 is very likely correct but we get better code if we - go through the conversion. */ return lvalue_required_p (gnat_parent, get_unpadded_type (Etype (gnat_parent)), constant, address_of_constant, aliased); + case N_Allocator: + /* We should only reach here through the N_Qualified_Expression case + and, therefore, only for composite types. Force an lvalue since + a block-copy to the newly allocated area of memory is made. */ + return 1; + case N_Explicit_Dereference: /* We look through dereferences for address of constant because we need to handle the special cases listed above. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c02f8600874..a409f22ff9b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-04-13 Eric Botcazou + + * gnat.dg/derived_type1.adb: New test. + 2010-04-13 Matthias Klose * gcc.dg/plugindir1.c: New testcase.