diff -Nrcpad gcc-4.5.1/gcc/ada/ChangeLog gcc-4.5.2/gcc/ada/ChangeLog *** gcc-4.5.1/gcc/ada/ChangeLog Sat Jul 31 09:25:39 2010 --- gcc-4.5.2/gcc/ada/ChangeLog Thu Dec 16 12:32:17 2010 *************** *** 1,3 **** --- 1,34 ---- + 2010-12-16 Release Manager + + * GCC 4.5.2 released. + + 2010-11-27 Eric Botcazou + + PR ada/40777 + * gcc-interface/targtyps.c (get_target_double_scalar_alignment): Guard + use of TARGET_64BIT macro. + + 2010-09-19 Eric Botcazou + + * gcc-interface/trans.c (gnat_pushdecl): Do not do anything special + for PARM_DECLs. + (end_subprog_body): If the body is a BIND_EXPR, make its associated + block the top-level one. + (build_function_stub): Build a statement group for the whole function. + * gcc-interface/utils.c (Subprogram_Body_to_gnu): If copy-in/copy-out + is used, create the enclosing block early and process first the OUT + parameters. + + 2010-09-19 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity) : Do + not generate debug info for individual enumerators. + + 2010-08-30 Eric Botcazou + + * gcc-interface/utils.c (gnat_pushdecl): Remove test for PARM_DECLs. + Attach fake PARM_DECLs to the topmost block of the function. + 2010-07-31 Release Manager * GCC 4.5.1 released. diff -Nrcpad gcc-4.5.1/gcc/ada/gcc-interface/decl.c gcc-4.5.2/gcc/ada/gcc-interface/decl.c *** gcc-4.5.1/gcc/ada/gcc-interface/decl.c Wed Nov 25 21:28:00 2009 --- gcc-4.5.2/gcc/ada/gcc-interface/decl.c Sun Sep 19 14:03:55 2010 *************** gnat_to_gnu_entity (Entity_Id gnat_entit *** 1445,1451 **** = create_var_decl (get_entity_name (gnat_literal), NULL_TREE, gnu_type, gnu_value, true, false, false, false, NULL, gnat_literal); ! save_gnu_tree (gnat_literal, gnu_literal, false); gnu_literal_list = tree_cons (DECL_NAME (gnu_literal), gnu_value, gnu_literal_list); --- 1445,1452 ---- = create_var_decl (get_entity_name (gnat_literal), NULL_TREE, gnu_type, gnu_value, true, false, false, false, NULL, gnat_literal); ! /* Do not generate debug info for individual enumerators. */ ! DECL_IGNORED_P (gnu_literal) = 1; save_gnu_tree (gnat_literal, gnu_literal, false); gnu_literal_list = tree_cons (DECL_NAME (gnu_literal), gnu_value, gnu_literal_list); diff -Nrcpad gcc-4.5.1/gcc/ada/gcc-interface/targtyps.c gcc-4.5.2/gcc/ada/gcc-interface/targtyps.c *** gcc-4.5.1/gcc/ada/gcc-interface/targtyps.c Mon Sep 28 17:00:46 2009 --- gcc-4.5.2/gcc/ada/gcc-interface/targtyps.c Sat Nov 27 18:47:06 2010 *************** Nat *** 249,256 **** get_target_double_scalar_alignment (void) { #ifdef TARGET_ALIGN_DOUBLE ! /* This macro is only defined by the i386 port. */ ! if (!TARGET_ALIGN_DOUBLE && !TARGET_64BIT) return 32 / BITS_PER_UNIT; #endif return 0; --- 249,260 ---- get_target_double_scalar_alignment (void) { #ifdef TARGET_ALIGN_DOUBLE ! /* This macro is only defined by the i386 and sh ports. */ ! if (!TARGET_ALIGN_DOUBLE ! #ifdef TARGET_64BIT ! && !TARGET_64BIT ! #endif ! ) return 32 / BITS_PER_UNIT; #endif return 0; diff -Nrcpad gcc-4.5.1/gcc/ada/gcc-interface/trans.c gcc-4.5.2/gcc/ada/gcc-interface/trans.c *** gcc-4.5.1/gcc/ada/gcc-interface/trans.c Sun Apr 25 09:25:47 2010 --- gcc-4.5.2/gcc/ada/gcc-interface/trans.c Sun Sep 19 14:55:41 2010 *************** Subprogram_Body_to_gnu (Node_Id gnat_nod *** 2236,2276 **** = GGC_CNEW (struct language_function); begin_subprog_body (gnu_subprog_decl); gnu_cico_list = TYPE_CI_CO_LIST (gnu_subprog_type); ! /* If there are Out parameters, we need to ensure that the return statement ! properly copies them out. We do this by making a new block and converting ! any inner return into a goto to a label at the end of the block. */ ! push_stack (&gnu_return_label_stack, NULL_TREE, ! gnu_cico_list ? create_artificial_label (input_location) ! : NULL_TREE); /* Get a tree corresponding to the code for the subprogram. */ start_stmt_group (); gnat_pushlevel (); - /* See if there are any parameters for which we don't yet have GCC entities. - These must be for Out parameters for which we will be making VAR_DECL - nodes here. Fill them in to TYPE_CI_CO_LIST, which must contain the empty - entry as well. We can match up the entries because TYPE_CI_CO_LIST is in - the order of the parameters. */ - for (gnat_param = First_Formal_With_Extras (gnat_subprog_id); - Present (gnat_param); - gnat_param = Next_Formal_With_Extras (gnat_param)) - if (!present_gnu_tree (gnat_param)) - { - /* Skip any entries that have been already filled in; they must - correspond to In Out parameters. */ - for (; gnu_cico_list && TREE_VALUE (gnu_cico_list); - gnu_cico_list = TREE_CHAIN (gnu_cico_list)) - ; - - /* Do any needed references for padded types. */ - TREE_VALUE (gnu_cico_list) - = convert (TREE_TYPE (TREE_PURPOSE (gnu_cico_list)), - gnat_to_gnu_entity (gnat_param, NULL_TREE, 1)); - } - /* On VMS, establish our condition handler to possibly turn a condition into the corresponding exception if the subprogram has a foreign convention or is exported. --- 2236,2284 ---- = GGC_CNEW (struct language_function); begin_subprog_body (gnu_subprog_decl); + + /* If there are In Out or Out parameters, we need to ensure that the return + statement properly copies them out. We do this by making a new block and + converting any return into a goto to a label at the end of the block. */ gnu_cico_list = TYPE_CI_CO_LIST (gnu_subprog_type); + if (gnu_cico_list) + { + push_stack (&gnu_return_label_stack, NULL_TREE, + create_artificial_label (input_location)); ! start_stmt_group (); ! gnat_pushlevel (); ! ! /* See whether there are parameters for which we don't have a GCC tree ! yet. These must be Out parameters. Make a VAR_DECL for them and ! put it into TYPE_CI_CO_LIST, which must contain an empty entry too. ! We can match up the entries because TYPE_CI_CO_LIST is in the order ! of the parameters. */ ! for (gnat_param = First_Formal_With_Extras (gnat_subprog_id); ! Present (gnat_param); ! gnat_param = Next_Formal_With_Extras (gnat_param)) ! if (!present_gnu_tree (gnat_param)) ! { ! tree gnu_cico_entry = gnu_cico_list; ! ! /* Skip any entries that have been already filled in; they must ! correspond to In Out parameters. */ ! while (gnu_cico_entry && TREE_VALUE (gnu_cico_entry)) ! gnu_cico_entry = TREE_CHAIN (gnu_cico_entry); ! ! /* Do any needed references for padded types. */ ! TREE_VALUE (gnu_cico_entry) ! = convert (TREE_TYPE (TREE_PURPOSE (gnu_cico_entry)), ! gnat_to_gnu_entity (gnat_param, NULL_TREE, 1)); ! } ! } ! else ! push_stack (&gnu_return_label_stack, NULL_TREE, NULL_TREE); /* Get a tree corresponding to the code for the subprogram. */ start_stmt_group (); gnat_pushlevel (); /* On VMS, establish our condition handler to possibly turn a condition into the corresponding exception if the subprogram has a foreign convention or is exported. *************** Subprogram_Body_to_gnu (Node_Id gnat_nod *** 2295,2338 **** gnat_poplevel (); gnu_result = end_stmt_group (); ! /* If we populated the parameter attributes cache, we need to make sure ! that the cached expressions are evaluated on all possible paths. */ ! cache = DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language->parm_attr_cache; ! if (cache) ! { ! struct parm_attr_d *pa; ! int i; ! ! start_stmt_group (); ! ! for (i = 0; VEC_iterate (parm_attr, cache, i, pa); i++) ! { ! if (pa->first) ! add_stmt_with_node (pa->first, gnat_node); ! if (pa->last) ! add_stmt_with_node (pa->last, gnat_node); ! if (pa->length) ! add_stmt_with_node (pa->length, gnat_node); ! } ! add_stmt (gnu_result); ! gnu_result = end_stmt_group (); ! } ! /* If we made a special return label, we need to make a block that contains ! the definition of that label and the copying to the return value. That ! block first contains the function, then the label and copy statement. */ ! if (TREE_VALUE (gnu_return_label_stack)) { tree gnu_retval; - start_stmt_group (); - gnat_pushlevel (); add_stmt (gnu_result); add_stmt (build1 (LABEL_EXPR, void_type_node, TREE_VALUE (gnu_return_label_stack))); - gnu_cico_list = TYPE_CI_CO_LIST (gnu_subprog_type); if (list_length (gnu_cico_list) == 1) gnu_retval = TREE_VALUE (gnu_cico_list); else --- 2303,2328 ---- gnat_poplevel (); gnu_result = end_stmt_group (); ! /* If we are dealing with a return from an Ada procedure with parameters ! passed by copy-in/copy-out, we need to return a record containing the ! final values of these parameters. If the list contains only one entry, ! return just that entry though. ! For a full description of the copy-in/copy-out parameter mechanism, see ! the part of the gnat_to_gnu_entity routine dealing with the translation ! of subprograms. ! We need to make a block that contains the definition of that label and ! the copying of the return value. It first contains the function, then ! the label and copy statement. */ ! if (gnu_cico_list) { tree gnu_retval; add_stmt (gnu_result); add_stmt (build1 (LABEL_EXPR, void_type_node, TREE_VALUE (gnu_return_label_stack))); if (list_length (gnu_cico_list) == 1) gnu_retval = TREE_VALUE (gnu_cico_list); else *************** Subprogram_Body_to_gnu (Node_Id gnat_nod *** 2351,2356 **** --- 2341,2370 ---- pop_stack (&gnu_return_label_stack); + /* If we populated the parameter attributes cache, we need to make sure + that the cached expressions are evaluated on all possible paths. */ + cache = DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language->parm_attr_cache; + if (cache) + { + struct parm_attr_d *pa; + int i; + + start_stmt_group (); + + for (i = 0; VEC_iterate (parm_attr, cache, i, pa); i++) + { + if (pa->first) + add_stmt_with_node (pa->first, gnat_node); + if (pa->last) + add_stmt_with_node (pa->last, gnat_node); + if (pa->length) + add_stmt_with_node (pa->length, gnat_node); + } + + add_stmt (gnu_result); + gnu_result = end_stmt_group (); + } + /* Set the end location. */ Sloc_to_locus ((Present (End_Label (Handled_Statement_Sequence (gnat_node))) diff -Nrcpad gcc-4.5.1/gcc/ada/gcc-interface/utils.c gcc-4.5.2/gcc/ada/gcc-interface/utils.c *** gcc-4.5.1/gcc/ada/gcc-interface/utils.c Mon Jan 18 17:55:03 2010 --- gcc-4.5.2/gcc/ada/gcc-interface/utils.c Sun Sep 19 14:55:41 2010 *************** gnat_poplevel (void) *** 423,433 **** void gnat_pushdecl (tree decl, Node_Id gnat_node) { ! /* If this decl is public external or at toplevel, there is no context. ! But PARM_DECLs always go in the level of its function. */ ! if (TREE_CODE (decl) != PARM_DECL ! && ((DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)) ! || global_bindings_p ())) DECL_CONTEXT (decl) = 0; else { --- 423,430 ---- void gnat_pushdecl (tree decl, Node_Id gnat_node) { ! /* If this decl is public external or at toplevel, there is no context. */ ! if ((TREE_PUBLIC (decl) && DECL_EXTERNAL (decl)) || global_bindings_p ()) DECL_CONTEXT (decl) = 0; else { *************** end_subprog_body (tree body) *** 2085,2093 **** { tree fndecl = current_function_decl; ! /* Mark the BLOCK for this level as being for this function and pop the ! level. Since the vars in it are the parameters, clear them. */ ! BLOCK_VARS (current_binding_level->block) = 0; BLOCK_SUPERCONTEXT (current_binding_level->block) = fndecl; DECL_INITIAL (fndecl) = current_binding_level->block; gnat_poplevel (); --- 2082,2088 ---- { tree fndecl = current_function_decl; ! /* Attach the BLOCK for this level to the function and pop the level. */ BLOCK_SUPERCONTEXT (current_binding_level->block) = fndecl; DECL_INITIAL (fndecl) = current_binding_level->block; gnat_poplevel (); *************** end_subprog_body (tree body) *** 2099,2104 **** --- 2094,2106 ---- /* Mark the RESULT_DECL as being in this subprogram. */ DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl; + /* The body should be a BIND_EXPR whose BLOCK is the top-level one. */ + if (TREE_CODE (body) == BIND_EXPR) + { + BLOCK_SUPERCONTEXT (BIND_EXPR_BLOCK (body)) = fndecl; + DECL_INITIAL (fndecl) = BIND_EXPR_BLOCK (body); + } + DECL_SAVED_TREE (fndecl) = body; current_function_decl = DECL_CONTEXT (fndecl); *************** build_function_stub (tree gnu_subprog, E *** 3471,3485 **** tree gnu_subprog_type, gnu_subprog_addr, gnu_subprog_call; tree gnu_stub_param, gnu_param_list, gnu_arg_types, gnu_param; tree gnu_stub_decl = DECL_FUNCTION_STUB (gnu_subprog); - tree gnu_body; gnu_subprog_type = TREE_TYPE (gnu_subprog); gnu_param_list = NULL_TREE; begin_subprog_body (gnu_stub_decl); - gnat_pushlevel (); start_stmt_group (); /* Loop over the parameters of the stub and translate any of them passed by descriptor into a by reference one. */ --- 3473,3490 ---- tree gnu_subprog_type, gnu_subprog_addr, gnu_subprog_call; tree gnu_stub_param, gnu_param_list, gnu_arg_types, gnu_param; tree gnu_stub_decl = DECL_FUNCTION_STUB (gnu_subprog); gnu_subprog_type = TREE_TYPE (gnu_subprog); gnu_param_list = NULL_TREE; + /* Initialize the information structure for the function. */ + allocate_struct_function (gnu_stub_decl, false); + set_cfun (NULL); + begin_subprog_body (gnu_stub_decl); start_stmt_group (); + gnat_pushlevel (); /* Loop over the parameters of the stub and translate any of them passed by descriptor into a by reference one. */ *************** build_function_stub (tree gnu_subprog, E *** 3501,3508 **** gnu_param_list = tree_cons (NULL_TREE, gnu_param, gnu_param_list); } - gnu_body = end_stmt_group (); - /* Invoke the internal subprogram. */ gnu_subprog_addr = build1 (ADDR_EXPR, build_pointer_type (gnu_subprog_type), gnu_subprog); --- 3506,3511 ---- *************** build_function_stub (tree gnu_subprog, E *** 3512,3527 **** /* Propagate the return value, if any. */ if (VOID_TYPE_P (TREE_TYPE (gnu_subprog_type))) ! append_to_statement_list (gnu_subprog_call, &gnu_body); else ! append_to_statement_list (build_return_expr (DECL_RESULT (gnu_stub_decl), ! gnu_subprog_call), ! &gnu_body); gnat_poplevel (); ! ! allocate_struct_function (gnu_stub_decl, false); ! end_subprog_body (gnu_body); } /* Build a type to be used to represent an aliased object whose nominal --- 3515,3527 ---- /* Propagate the return value, if any. */ if (VOID_TYPE_P (TREE_TYPE (gnu_subprog_type))) ! add_stmt (gnu_subprog_call); else ! add_stmt (build_return_expr (DECL_RESULT (gnu_stub_decl), ! gnu_subprog_call)); gnat_poplevel (); ! end_subprog_body (end_stmt_group ()); } /* Build a type to be used to represent an aliased object whose nominal diff -Nrcpad gcc-4.5.1/gnattools/ChangeLog gcc-4.5.2/gnattools/ChangeLog *** gcc-4.5.1/gnattools/ChangeLog Sat Jul 31 09:23:26 2010 --- gcc-4.5.2/gnattools/ChangeLog Thu Dec 16 12:30:12 2010 *************** *** 1,3 **** --- 1,7 ---- + 2010-12-16 Release Manager + + * GCC 4.5.2 released. + 2010-07-31 Release Manager * GCC 4.5.1 released. diff -Nrcpad gcc-4.5.1/libada/ChangeLog gcc-4.5.2/libada/ChangeLog *** gcc-4.5.1/libada/ChangeLog Sat Jul 31 09:24:26 2010 --- gcc-4.5.2/libada/ChangeLog Thu Dec 16 12:31:11 2010 *************** *** 1,3 **** --- 1,7 ---- + 2010-12-16 Release Manager + + * GCC 4.5.2 released. + 2010-07-31 Release Manager * GCC 4.5.1 released.