diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-14 20:54:22 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-14 20:54:22 +0000 |
commit | 2a4b892970941759663bda9f6464dbff415b06cf (patch) | |
tree | 21ac4dc1e8f7684dfc4e43a947417c41369a1b86 /gcc/ada | |
parent | c7f0a362d24042abe9d77e4201270872dda1704a (diff) | |
download | gcc-2a4b892970941759663bda9f6464dbff415b06cf.tar.gz |
2009-09-14 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 151701
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@151702 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 40 | ||||
-rw-r--r-- | gcc/ada/exp_dbug.ads | 26 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 18 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/misc.c | 1 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 15 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 20 |
6 files changed, 90 insertions, 30 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7d4d8aad293..cb38dab12f0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,13 +1,39 @@ +2009-09-14 Richard Henderson <rth@redhat.com> + + * gcc-interface/trans.c (Pragma_to_gnu): Use build5 for ASM_EXPR. + +2009-09-14 Eric Botcazou <ebotcazou@adacore.com> + + * exp_dbug.ads (Packed Array Encoding): Document the new encoding for + the unconstrained case. + * gcc-interfaces/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Implement + the encoding. Do not give a name to the pointer type to the XUT type. + * gcc-interfaces/utils.c (gnat_pushdecl): Propagate DECL_ORIGINAL_TYPE + for fat pointer types, if any. Make sure DECL_ARTIFICIAL is cleared + on nodes with DECL_ORIGINAL_TYPE set. + (update_pointer_to): Set DECL_ORIGINAL_TYPE to the original pointer + for fat pointer types. Make sure DECL_ARTIFICIAL is cleared. + +2009-09-14 Richard Henderson <rth@redhat.com> + + * gcc-interface/misc.c (gnat_init_gcc_eh): Don't call + default_init_unwind_resume_libfunc. + * gcc-interface/trans.c (Exception_Handler_to_gnu_zcx): Use + __builtin_eh_pointer. + * gcc-interface/utils.c (gnat_install_builtins): Update call + to build_common_builtin_nodes. + 2009-09-13 Richard Guenther <rguenther@suse.de> - Rafael Avila de Espindola <espindola@google.com> + Rafael Avila de Espindola <espindola@google.com> - * gcc-interface/misc.c (gnat_init_gcc_eh): Do not set - lang_eh_runtime_type. + * gcc-interface/misc.c (gnat_init_gcc_eh): Do not set variables + eh_personality_libfunc and lang_eh_runtime_type. (LANG_HOOKS_EH_PERSONALITY): Define. - (gnat_eh_personality_decl): New. - (gnat_eh_personality): Likewise. - * Make-lang.in (misc.o): Add gt-ada-misc.h dependency. - * config-lang.in (gtfiles): Add misc.c. + (gnat_eh_personality_decl): New static variable. + (gnat_eh_personality): New static function. + Include gt-ada-misc.h. + * gcc-interface/Make-lang.in (misc.o): Add gt-ada-misc.h dependency. + * gcc-interface/config-lang.in (gtfiles): Add misc.c. 2009-09-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> diff --git a/gcc/ada/exp_dbug.ads b/gcc/ada/exp_dbug.ads index 2b30248a78c..3c3144641d8 100644 --- a/gcc/ada/exp_dbug.ads +++ b/gcc/ada/exp_dbug.ads @@ -1094,8 +1094,8 @@ package Exp_Dbug is -- Packed Array Encoding -- --------------------------- - -- For every packed array, two types are created, and both appear in - -- the debugging output. + -- For every constrained packed array, two types are created, and both + -- appear in the debugging output: -- The original declared array type is a perfectly normal array type, -- and its index bounds indicate the original bounds of the array. @@ -1110,12 +1110,27 @@ package Exp_Dbug is -- ttt___XPnnn -- where + -- ttt is the name of the original declared array -- nnn is the component size in bits (1-31) - -- When the debugger sees that an object is of a type that is encoded - -- in this manner, it can use the original type to determine the bounds, - -- and the component size to determine the packing details. + -- When the debugger sees that an object is of a type that is encoded in + -- this manner, it can use the original type to determine the bounds and + -- the component type, and the component size to determine the packing + -- details. + + -- For an unconstrained packed array, the corresponding packed array type + -- is neither used in the generated code nor for debugging information, + -- only the original type is used. In order to convey the packing in the + -- debugging information, the compiler generates the associated fat- and + -- thin-pointer types (see the Pointers to Unconstrained Array section + -- below) using the name of the corresponding packed array type as the + -- base name, i.e. ttt___XPnnn___XUP and ttt___XPnnn___XUT respectively. + + -- When the debugger sees that an object is of a type that is encoded in + -- this manner, it can use the type of the fields to determine the bounds + -- and the component type, and the component size to determine the packing + -- details. ------------------------------------------- -- Packed Array Representation in Memory -- @@ -1257,6 +1272,7 @@ package Exp_Dbug is -- fat-pointer type whose name is "arr___XUP", where "arr" is the name -- of the array type, and use it to represent the array type itself in -- the debugging information. + -- For each pointer to this unconstrained array type, the compiler will -- generate a typedef that points to the above "arr___XUP" fat-pointer -- type. As a consequence, when it comes to fat-pointer types: diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 255821e49c8..ed393388c5c 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -1782,7 +1782,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) case E_String_Type: case E_Array_Type: { - Entity_Id gnat_index; + Entity_Id gnat_index, gnat_name; const bool convention_fortran_p = (Convention (gnat_entity) == Convention_Fortran); const int ndim = Number_Dimensions (gnat_entity); @@ -2066,8 +2066,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) tem, NULL, !Comes_From_Source (gnat_entity), debug_info_p, gnat_entity); - /* Give the fat pointer type a name. */ - create_type_decl (create_concat_name (gnat_entity, "XUP"), + /* Give the fat pointer type a name. If this is a packed type, tell + the debugger how to interpret the underlying bits. */ + if (Present (Packed_Array_Type (gnat_entity))) + gnat_name = Packed_Array_Type (gnat_entity); + else + gnat_name = gnat_entity; + create_type_decl (create_concat_name (gnat_name, "XUP"), gnu_fat_type, NULL, true, debug_info_p, gnat_entity); @@ -2075,16 +2080,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) record type for the object and its template with the field offsets shifted to have the template at a negative offset. */ tem = build_unc_object_type (gnu_template_type, tem, - create_concat_name (gnat_entity, "XUT")); + create_concat_name (gnat_name, "XUT")); shift_unc_components_for_thin_pointers (tem); SET_TYPE_UNCONSTRAINED_ARRAY (tem, gnu_type); TYPE_OBJECT_RECORD_TYPE (gnu_type) = tem; - - /* Give the thin pointer type a name. */ - create_type_decl (create_concat_name (gnat_entity, "XUX"), - build_pointer_type (tem), NULL, true, - debug_info_p, gnat_entity); } break; diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 261351f840c..26df68de581 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -435,7 +435,6 @@ gnat_init_gcc_eh (void) using_eh_for_cleanups (); lang_eh_type_covers = gnat_eh_type_covers; - default_init_unwind_resume_libfunc (); /* Turn on -fexceptions and -fnon-call-exceptions. The first one triggers the generation of the necessary exception runtime tables. The second one diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 29ab72a365f..5bce21a7063 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -1026,14 +1026,14 @@ Pragma_to_gnu (Node_Id gnat_node) asm_constraint = build_string (strlen (comment), comment); free (comment); #endif - gnu_expr = build4 (ASM_EXPR, void_type_node, + gnu_expr = build5 (ASM_EXPR, void_type_node, asm_constraint, NULL_TREE, tree_cons (build_tree_list (NULL_TREE, build_string (1, "g")), gnu_expr, NULL_TREE), - NULL_TREE); + NULL_TREE, NULL_TREE); ASM_VOLATILE_P (gnu_expr) = 1; set_expr_location_from_node (gnu_expr, gnat_node); append_to_statement_list (gnu_expr, &gnu_result); @@ -3304,7 +3304,7 @@ Exception_Handler_to_gnu_zcx (Node_Id gnat_node) a new occurrence on top of the stack, which means that this top does not necessarily match the occurrence this handler was dealing with. - The EXC_PTR_EXPR object references the exception occurrence being + __builtin_eh_pointer references the exception occurrence being propagated. Upon handler entry, this is the exception for which the handler is triggered. This might not be the case upon handler exit, however, as we might have a new occurrence propagated by the handler's @@ -3312,7 +3312,10 @@ Exception_Handler_to_gnu_zcx (Node_Id gnat_node) We use a local variable to retrieve the incoming value at handler entry time, and reuse it to feed the end_handler hook's argument at exit. */ - gnu_current_exc_ptr = build0 (EXC_PTR_EXPR, ptr_type_node); + + gnu_current_exc_ptr + = build_call_expr (built_in_decls [BUILT_IN_EH_POINTER], + 1, integer_zero_node); gnu_incoming_exc_ptr = create_var_decl (get_identifier ("EXPTR"), NULL_TREE, ptr_type_node, gnu_current_exc_ptr, false, false, false, false, NULL, @@ -5085,9 +5088,9 @@ gnat_to_gnu (Node_Id gnat_node) TREE_VALUE (tail) = input; } - gnu_result = build4 (ASM_EXPR, void_type_node, + gnu_result = build5 (ASM_EXPR, void_type_node, gnu_template, gnu_outputs, - gnu_inputs, gnu_clobbers); + gnu_inputs, gnu_clobbers, NULL_TREE); ASM_VOLATILE_P (gnu_result) = Is_Asm_Volatile (gnat_node); } else diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 9748caf5463..31f24ce0340 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -495,8 +495,12 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) TYPE_NAME (tt) = decl; TREE_USED (tt) = TREE_USED (t); TREE_TYPE (decl) = tt; - DECL_ORIGINAL_TYPE (decl) = t; + if (DECL_ORIGINAL_TYPE (TYPE_NAME (t))) + DECL_ORIGINAL_TYPE (decl) = DECL_ORIGINAL_TYPE (TYPE_NAME (t)); + else + DECL_ORIGINAL_TYPE (decl) = t; t = NULL_TREE; + DECL_ARTIFICIAL (decl) = 0; } else if (DECL_ARTIFICIAL (TYPE_NAME (t)) && !DECL_ARTIFICIAL (decl)) ; @@ -3665,6 +3669,18 @@ update_pointer_to (tree old_type, tree new_type) TYPE_POINTER_TO (new_type) = TYPE_REFERENCE_TO (new_type) = TREE_TYPE (new_type) = ptr; + /* And show the original pointer NEW_PTR to the debugger. This is the + counterpart of the equivalent processing in gnat_pushdecl when the + unconstrained array type is frozen after access types to it. Note + that update_pointer_to can be invoked multiple times on the same + couple of types because of the type variants. */ + if (TYPE_NAME (ptr) + && TREE_CODE (TYPE_NAME (ptr)) == TYPE_DECL + && !DECL_ORIGINAL_TYPE (TYPE_NAME (ptr))) + { + DECL_ORIGINAL_TYPE (TYPE_NAME (ptr)) = new_ptr; + DECL_ARTIFICIAL (TYPE_NAME (ptr)) = 0; + } for (var = TYPE_MAIN_VARIANT (ptr); var; var = TYPE_NEXT_VARIANT (var)) SET_TYPE_UNCONSTRAINED_ARRAY (var, new_type); @@ -5439,7 +5455,7 @@ gnat_install_builtins (void) know about internal specificities and control attributes accordingly, for instance __builtin_alloca vs no-throw and -fstack-check. We will ignore the generic definition from builtins.def. */ - build_common_builtin_nodes (); + build_common_builtin_nodes (false); /* Now, install the target specific builtins, such as the AltiVec family on ppc, and the common set as exposed by builtins.def. */ |