diff -Nrcpad gcc-4.1.1/gcc/ada/ChangeLog gcc-4.1.2/gcc/ada/ChangeLog *** gcc-4.1.1/gcc/ada/ChangeLog Wed May 24 23:42:05 2006 --- gcc-4.1.2/gcc/ada/ChangeLog Wed Feb 14 05:11:35 2007 *************** *** 1,3 **** --- 1,32 ---- + 2007-02-13 Release Manager + + * GCC 4.1.2 released. + + 2006-09-13 Olivier Hainque + + PR ada/29025 + * trans.c (gnat_gimplify_expr) : When taking the address + of a SAVE_EXPR, just make the operand addressable/not-readonly and + let the common gimplifier code make and propagate a temporary copy. + (call_to_gnu): Clarify the use of SAVE_EXPR for not addressable + out/in-out actuals and defer setting the addressable/readonly bits + to the gimplifier. + + 2006-09-13 Eric Botcazou + + PR ada/21952 + * gigi.h (gnat_internal_attribute_table): Declare. + * misc.c (LANG_HOOKS_ATTRIBUTE_TABLE): Define to above. + * utils.c (gnat_internal_attribute_table): New global variable. + (builtin_function): Always call decl_attributes on the builtin. + (handle_const_attribute): New static function. + (handle_nothrow_attribute): Likewise. + + 2006-06-06 Laurent GUERBY + + PR ada/27769 + mlib-utl.adb: Use Program_Name. + 2006-05-24 Release Manager * GCC 4.1.1 released. diff -Nrcpad gcc-4.1.1/gcc/ada/gigi.h gcc-4.1.2/gcc/ada/gigi.h *** gcc-4.1.1/gcc/ada/gigi.h Tue Nov 15 13:53:22 2005 --- gcc-4.1.2/gcc/ada/gigi.h Wed Sep 13 18:27:46 2006 *************** extern int force_global; *** 309,315 **** type whose bit width is Pmode. Assume "long" is such a type here. */ #undef SIZE_TYPE #define SIZE_TYPE "long int" - /* Data structures used to represent attributes. */ --- 309,314 ---- *************** struct attrib *** 332,337 **** --- 331,339 ---- Node_Id error_point; }; + /* Table of machine-independent internal attributes. */ + extern const struct attribute_spec gnat_internal_attribute_table[]; + /* Define the entries in the standard data array. */ enum standard_datatypes { diff -Nrcpad gcc-4.1.1/gcc/ada/misc.c gcc-4.1.2/gcc/ada/misc.c *** gcc-4.1.1/gcc/ada/misc.c Thu Dec 15 13:29:14 2005 --- gcc-4.1.2/gcc/ada/misc.c Wed Sep 13 18:27:46 2006 *************** static tree gnat_type_max_size (tree); *** 158,163 **** --- 158,165 ---- #define LANG_HOOKS_UNSIGNED_TYPE gnat_unsigned_type #undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE #define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE gnat_signed_or_unsigned_type + #undef LANG_HOOKS_ATTRIBUTE_TABLE + #define LANG_HOOKS_ATTRIBUTE_TABLE gnat_internal_attribute_table const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; diff -Nrcpad gcc-4.1.1/gcc/ada/mlib-utl.adb gcc-4.1.2/gcc/ada/mlib-utl.adb *** gcc-4.1.1/gcc/ada/mlib-utl.adb Tue Nov 15 14:06:45 2005 --- gcc-4.1.2/gcc/ada/mlib-utl.adb Tue Jun 6 12:37:36 2006 *************** package body MLib.Utl is *** 38,44 **** Initialized : Boolean := False; ! Gcc_Name : constant String := "gcc"; Gcc_Exec : OS_Lib.String_Access; Ar_Name : OS_Lib.String_Access; --- 38,44 ---- Initialized : Boolean := False; ! Gcc_Name : constant String := Osint.Program_Name ("gcc").all; Gcc_Exec : OS_Lib.String_Access; Ar_Name : OS_Lib.String_Access; *************** package body MLib.Utl is *** 260,266 **** -- ar ! Ar_Name := new String'(Archive_Builder); Ar_Exec := OS_Lib.Locate_Exec_On_Path (Ar_Name.all); if Ar_Exec = null then --- 260,266 ---- -- ar ! Ar_Name := Osint.Program_Name (Archive_Builder); Ar_Exec := OS_Lib.Locate_Exec_On_Path (Ar_Name.all); if Ar_Exec = null then *************** package body MLib.Utl is *** 275,281 **** -- ranlib ! Ranlib_Name := new String'(Archive_Indexer); if Ranlib_Name'Length > 0 then Ranlib_Exec := OS_Lib.Locate_Exec_On_Path (Ranlib_Name.all); --- 275,281 ---- -- ranlib ! Ranlib_Name := Osint.Program_Name (Archive_Indexer); if Ranlib_Name'Length > 0 then Ranlib_Exec := OS_Lib.Locate_Exec_On_Path (Ranlib_Name.all); diff -Nrcpad gcc-4.1.1/gcc/ada/trans.c gcc-4.1.2/gcc/ada/trans.c *** gcc-4.1.1/gcc/ada/trans.c Thu Nov 17 21:03:50 2005 --- gcc-4.1.2/gcc/ada/trans.c Wed Sep 13 18:48:46 2006 *************** call_to_gnu (Node_Id gnat_node, tree *gn *** 1687,1704 **** && (TYPE_JUSTIFIED_MODULAR_P (gnu_name_type))) gnu_name = convert (gnu_name_type, gnu_name); gnu_actual = save_expr (gnu_name); - /* Since we're going to take the address of the SAVE_EXPR, we - don't want it to be marked as unchanging. So set - TREE_ADDRESSABLE. */ - gnu_temp = skip_simple_arithmetic (gnu_actual); - if (TREE_CODE (gnu_temp) == SAVE_EXPR) - { - TREE_ADDRESSABLE (gnu_temp) = 1; - TREE_READONLY (gnu_temp) = 0; - } - /* Set up to move the copy back to the original. */ gnu_temp = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_copy, gnu_actual); --- 1687,1698 ---- && (TYPE_JUSTIFIED_MODULAR_P (gnu_name_type))) gnu_name = convert (gnu_name_type, gnu_name); + /* Make a SAVE_EXPR to both properly account for potential side + effects and handle the creation of a temporary copy. Special + code in gnat_gimplify_expr ensures that the same temporary is + used as the actual and copied back after the call. */ gnu_actual = save_expr (gnu_name); /* Set up to move the copy back to the original. */ gnu_temp = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_copy, gnu_actual); *************** gnat_gimplify_expr (tree *expr_p, tree * *** 4621,4626 **** --- 4615,4633 ---- return GS_ALL_DONE; } + /* If we are taking the address of a SAVE_EXPR, we are typically + processing a misaligned argument to be passed by reference in a + procedure call. We just mark the operand as addressable + not + readonly here and let the common gimplifier code perform the + temporary creation, initialization, and "instantiation" in place of + the SAVE_EXPR in further operands, in particular in the copy back + code inserted after the call. */ + else if (TREE_CODE (op) == SAVE_EXPR) + { + TREE_ADDRESSABLE (op) = 1; + TREE_READONLY (op) = 0; + } + /* Otherwise, if we are taking the address of something that is neither reference, declaration, or constant, make a variable for the operand here and then take its address. If we don't do it this way, we may diff -Nrcpad gcc-4.1.1/gcc/ada/utils.c gcc-4.1.2/gcc/ada/utils.c *** gcc-4.1.1/gcc/ada/utils.c Tue Nov 15 13:53:22 2005 --- gcc-4.1.2/gcc/ada/utils.c Wed Sep 13 18:27:46 2006 *************** tree gnat_raise_decls[(int) LAST_REASON_ *** 79,84 **** --- 79,99 ---- tree static_ctors; tree static_dtors; + /* Forward declarations for handlers of attributes. */ + static tree handle_const_attribute (tree *, tree, tree, int, bool *); + static tree handle_nothrow_attribute (tree *, tree, tree, int, bool *); + + /* Table of machine-independent internal attributes for Ada. We support + this minimal set ot attributes to accomodate the Alpha back-end which + unconditionally puts them on its builtins. */ + const struct attribute_spec gnat_internal_attribute_table[] = + { + /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ + { "const", 0, 0, true, false, false, handle_const_attribute }, + { "nothrow", 0, 0, true, false, false, handle_nothrow_attribute }, + { NULL, 0, 0, false, false, false, NULL } + }; + /* Associates a GNAT tree node to a GCC tree node. It is used in `save_gnu_tree', `get_gnu_tree' and `present_gnu_tree'. See documentation of `save_gnu_tree' for more info. */ *************** builtin_function (const char *name, tree *** 1826,1836 **** gnat_pushdecl (decl, Empty); DECL_BUILT_IN_CLASS (decl) = class; DECL_FUNCTION_CODE (decl) = function_code; if (attrs) ! decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN); return decl; } /* Return an integer type with the number of bits of precision given by PRECISION. UNSIGNEDP is nonzero if the type is unsigned; otherwise it is a signed type. */ --- 1841,1888 ---- gnat_pushdecl (decl, Empty); DECL_BUILT_IN_CLASS (decl) = class; DECL_FUNCTION_CODE (decl) = function_code; + + /* Possibly apply some default attributes to this built-in function. */ if (attrs) ! decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN); ! else ! decl_attributes (&decl, NULL_TREE, 0); ! return decl; } + /* Handle a "const" attribute; arguments as in + struct attribute_spec.handler. */ + + static tree + handle_const_attribute (tree *node, tree ARG_UNUSED (name), + tree ARG_UNUSED (args), int ARG_UNUSED (flags), + bool *no_add_attrs) + { + if (TREE_CODE (*node) == FUNCTION_DECL) + TREE_READONLY (*node) = 1; + else + *no_add_attrs = true; + + return NULL_TREE; + } + + /* Handle a "nothrow" attribute; arguments as in + struct attribute_spec.handler. */ + + static tree + handle_nothrow_attribute (tree *node, tree ARG_UNUSED (name), + tree ARG_UNUSED (args), int ARG_UNUSED (flags), + bool *no_add_attrs) + { + if (TREE_CODE (*node) == FUNCTION_DECL) + TREE_NOTHROW (*node) = 1; + else + *no_add_attrs = true; + + return NULL_TREE; + } + /* Return an integer type with the number of bits of precision given by PRECISION. UNSIGNEDP is nonzero if the type is unsigned; otherwise it is a signed type. */ diff -Nrcpad gcc-4.1.1/gnattools/ChangeLog gcc-4.1.2/gnattools/ChangeLog *** gcc-4.1.1/gnattools/ChangeLog Wed May 24 23:43:25 2006 --- gcc-4.1.2/gnattools/ChangeLog Wed Feb 14 05:13:23 2007 *************** *** 1,3 **** --- 1,7 ---- + 2007-02-13 Release Manager + + * GCC 4.1.2 released. + 2006-05-24 Release Manager * GCC 4.1.1 released. diff -Nrcpad gcc-4.1.1/libada/ChangeLog gcc-4.1.2/libada/ChangeLog *** gcc-4.1.1/libada/ChangeLog Wed May 24 23:42:35 2006 --- gcc-4.1.2/libada/ChangeLog Wed Feb 14 05:12:16 2007 *************** *** 1,3 **** --- 1,7 ---- + 2007-02-13 Release Manager + + * GCC 4.1.2 released. + 2006-05-24 Release Manager * GCC 4.1.1 released.