diff -Nrcpad gcc-4.0.2/gcc/ada/ChangeLog gcc-4.0.3/gcc/ada/ChangeLog *** gcc-4.0.2/gcc/ada/ChangeLog Wed Sep 21 03:55:43 2005 --- gcc-4.0.3/gcc/ada/ChangeLog Thu Mar 9 20:44:35 2006 *************** *** 1,3 **** --- 1,63 ---- + 2006-03-09 Release Manager + + * GCC 4.0.3 released. + + 2006-02-17 Eric Botcazou + + Backport from mainline: + 2006-02-13 Geert Bosch + Gary Dismukes + + * a-tifiio.adb (Put_Digits): Test Last against To'First - 1 instead of + 0, since the lower bound of the actual string may be greater than one. + + PR ada/20753 + + (Put): Fix condition to raise Layout_Error when invalid + layout is requested. + + 2006-01-20 John David Anglin + + PR ada/24533 + * s-osinte-linux-hppa.ads: Reduce alignment of atomic_lock_t to 8. + + 2005-12-28 John David Anglin + + * s-osinte-linux-hppa.ads: Correct alignment of atomic_lock_t. + + 2005-11-14 Robert Dewar + + PR ada/18434 + * osint-m.adb: Add pragma Elaborate_All for Osint + + 2005-11-10 Eric Botcazou + + PR ada/23995 + * trans.c (call_to_gnu): Restore statement lost in translation. + + 2005-09-21 Olivier Hainque + + PR ada/22418 + * decl.c (maybe_pad_type): Use proper bitsizetype for XVZ objects, + as we create them to store a size in bits. + + 2005-10-21 Eric Botcazou + + PR ada/21937 + PR ada/22328 + PR ada/22381 + PR ada/22383 + PR ada/22419 + PR ada/22420 + * utils2.c (build_return_expr): New helper function. + * gigi.h (build_return_expr): Declare it. + * trans.c (Subprogram_Body_to_gnu): Use build_return_expr instead + of manually building the RETURN_EXPR tree. + (call_to_gnu): Pass MODIFY_EXPR through build_binary_op. + (gnat_to_gnu) : Pass MODIFY_EXPR through + build_binary_op for the "target pointer" case. Use build_return_expr + instead of manually building the RETURN_EXPR tree. + 2005-09-20 Release Manager * GCC 4.0.2 released. diff -Nrcpad gcc-4.0.2/gcc/ada/a-tifiio.adb gcc-4.0.3/gcc/ada/a-tifiio.adb *** gcc-4.0.2/gcc/ada/a-tifiio.adb Mon Mar 15 14:50:55 2004 --- gcc-4.0.3/gcc/ada/a-tifiio.adb Fri Feb 17 11:21:46 2006 *************** *** 6,12 **** -- -- -- B o d y -- -- -- ! -- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- --- 6,12 ---- -- -- -- B o d y -- -- -- ! -- Copyright (C) 1992-2006 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- *************** package body Ada.Text_IO.Fixed_IO is *** 314,322 **** --------- procedure Get ! (File : in File_Type; Item : out Num; ! Width : in Field := 0) is pragma Unsuppress (Range_Check); --- 314,322 ---- --------- procedure Get ! (File : File_Type; Item : out Num; ! Width : Field := 0) is pragma Unsuppress (Range_Check); *************** package body Ada.Text_IO.Fixed_IO is *** 329,335 **** procedure Get (Item : out Num; ! Width : in Field := 0) is pragma Unsuppress (Range_Check); --- 329,335 ---- procedure Get (Item : out Num; ! Width : Field := 0) is pragma Unsuppress (Range_Check); *************** package body Ada.Text_IO.Fixed_IO is *** 341,347 **** end Get; procedure Get ! (From : in String; Item : out Num; Last : out Positive) is --- 341,347 ---- end Get; procedure Get ! (From : String; Item : out Num; Last : out Positive) is *************** package body Ada.Text_IO.Fixed_IO is *** 359,369 **** --------- procedure Put ! (File : in File_Type; ! Item : in Num; ! Fore : in Field := Default_Fore; ! Aft : in Field := Default_Aft; ! Exp : in Field := Default_Exp) is S : String (1 .. Fore + Aft + Exp + Extra_Layout_Space); Last : Natural; --- 359,369 ---- --------- procedure Put ! (File : File_Type; ! Item : Num; ! Fore : Field := Default_Fore; ! Aft : Field := Default_Aft; ! Exp : Field := Default_Exp) is S : String (1 .. Fore + Aft + Exp + Extra_Layout_Space); Last : Natural; *************** package body Ada.Text_IO.Fixed_IO is *** 373,382 **** end Put; procedure Put ! (Item : in Num; ! Fore : in Field := Default_Fore; ! Aft : in Field := Default_Aft; ! Exp : in Field := Default_Exp) is S : String (1 .. Fore + Aft + Exp + Extra_Layout_Space); Last : Natural; --- 373,382 ---- end Put; procedure Put ! (Item : Num; ! Fore : Field := Default_Fore; ! Aft : Field := Default_Aft; ! Exp : Field := Default_Exp) is S : String (1 .. Fore + Aft + Exp + Extra_Layout_Space); Last : Natural; *************** package body Ada.Text_IO.Fixed_IO is *** 387,395 **** procedure Put (To : out String; ! Item : in Num; ! Aft : in Field := Default_Aft; ! Exp : in Field := Default_Exp) is Fore : constant Integer := To'Length - 1 -- Decimal point --- 387,395 ---- procedure Put (To : out String; ! Item : Num; ! Aft : Field := Default_Aft; ! Exp : Field := Default_Exp) is Fore : constant Integer := To'Length - 1 -- Decimal point *************** package body Ada.Text_IO.Fixed_IO is *** 399,405 **** Last : Natural; begin ! if Fore not in Field'Range then raise Layout_Error; end if; --- 399,405 ---- Last : Natural; begin ! if Fore < 1 or else Fore > Field'Last then raise Layout_Error; end if; *************** package body Ada.Text_IO.Fixed_IO is *** 419,428 **** Exp : Field) is subtype Digit is Int64 range 0 .. 9; ! X : constant Int64 := Int64'Integer_Value (Item); ! A : constant Field := Field'Max (Aft, 1); ! Neg : constant Boolean := (Item < 0.0); ! Pos : Integer; -- Next digit X has value X * 10.0**Pos; Y, Z : Int64; E : constant Integer := Boolean'Pos (not Exact) --- 419,429 ---- Exp : Field) is subtype Digit is Int64 range 0 .. 9; ! ! X : constant Int64 := Int64'Integer_Value (Item); ! A : constant Field := Field'Max (Aft, 1); ! Neg : constant Boolean := (Item < 0.0); ! Pos : Integer; -- Next digit X has value X * 10.0**Pos; Y, Z : Int64; E : constant Integer := Boolean'Pos (not Exact) *************** package body Ada.Text_IO.Fixed_IO is *** 438,444 **** procedure Put_Digit (X : Digit); -- Add digit X to the output string (going from left to right), ! -- updating Last and Pos, and inserting the sign, leading zeroes -- or a decimal point when necessary. After outputting the first -- digit, Pos must not be changed outside Put_Digit anymore --- 439,445 ---- procedure Put_Digit (X : Digit); -- Add digit X to the output string (going from left to right), ! -- updating Last and Pos, and inserting the sign, leading zeros -- or a decimal point when necessary. After outputting the first -- digit, Pos must not be changed outside Put_Digit anymore *************** package body Ada.Text_IO.Fixed_IO is *** 470,480 **** procedure Put_Digit (X : Digit) is Digs : constant array (Digit) of Character := "0123456789"; begin ! if Last = 0 then if X /= 0 or Pos <= 0 then -- Before outputting first digit, include leading space, ! -- posible minus sign and, if the first digit is fractional, -- decimal seperator and leading zeros. -- The Fore part has Pos + 1 + Boolean'Pos (Neg) characters, --- 471,482 ---- procedure Put_Digit (X : Digit) is Digs : constant array (Digit) of Character := "0123456789"; + begin ! if Last = To'First - 1 then if X /= 0 or Pos <= 0 then -- Before outputting first digit, include leading space, ! -- possible minus sign and, if the first digit is fractional, -- decimal seperator and leading zeros. -- The Fore part has Pos + 1 + Boolean'Pos (Neg) characters, diff -Nrcpad gcc-4.0.2/gcc/ada/decl.c gcc-4.0.3/gcc/ada/decl.c *** gcc-4.0.2/gcc/ada/decl.c Thu Mar 17 19:53:06 2005 --- gcc-4.0.3/gcc/ada/decl.c Fri Oct 21 15:49:58 2005 *************** maybe_pad_type (tree type, tree size, un *** 4908,4914 **** if (size && TREE_CODE (size) != INTEGER_CST && definition) create_var_decl (concat_id_with_name (name, "XVZ"), NULL_TREE, ! sizetype, TYPE_SIZE (record), false, false, false, false, NULL, gnat_entity); } --- 4908,4914 ---- if (size && TREE_CODE (size) != INTEGER_CST && definition) create_var_decl (concat_id_with_name (name, "XVZ"), NULL_TREE, ! bitsizetype, TYPE_SIZE (record), false, false, false, false, NULL, gnat_entity); } diff -Nrcpad gcc-4.0.2/gcc/ada/gigi.h gcc-4.0.3/gcc/ada/gigi.h *** gcc-4.0.2/gcc/ada/gigi.h Thu Mar 17 19:53:06 2005 --- gcc-4.0.3/gcc/ada/gigi.h Fri Oct 21 15:47:47 2005 *************** extern tree build_unary_op (enum tree_co *** 636,641 **** --- 636,644 ---- /* Similar, but for COND_EXPR. */ extern tree build_cond_expr (tree, tree, tree, tree); + /* Similar, but for RETURN_EXPR. */ + extern tree build_return_expr (tree result_decl, tree ret_val); + /* Build a CALL_EXPR to call FUNDECL with one argument, ARG. Return the CALL_EXPR. */ extern tree build_call_1_expr (tree, tree); diff -Nrcpad gcc-4.0.2/gcc/ada/osint-m.adb gcc-4.0.3/gcc/ada/osint-m.adb *** gcc-4.0.2/gcc/ada/osint-m.adb Thu Apr 24 17:54:07 2003 --- gcc-4.0.3/gcc/ada/osint-m.adb Mon Nov 14 21:34:34 2005 *************** *** 6,12 **** -- -- -- B o d y -- -- -- ! -- Copyright (C) 2001 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- --- 6,12 ---- -- -- -- B o d y -- -- -- ! -- Copyright (C) 2001-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- *************** *** 16,29 **** -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- ! -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ! -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body Osint.M is ----------------------- --- 16,40 ---- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- ! -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- ! -- Boston, MA 02110-1301, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ + with Osint; + + pragma Elaborate_All (Osint); + -- This pragma is needed because of the call to Set_Program in the + -- elaboration of the package. We cannot rely on the static model + -- of elaboration since the compiler is routinely compiled with + -- checks off (-gnatp), and with older versions of the compiler + -- (up to and including most 5.04 wavefronts), -gnatp suppresses + -- the static elaboration check mechanisms. It could be removed + -- one day, but there really is no need to do so. + package body Osint.M is ----------------------- diff -Nrcpad gcc-4.0.2/gcc/ada/s-osinte-linux-hppa.ads gcc-4.0.3/gcc/ada/s-osinte-linux-hppa.ads *** gcc-4.0.2/gcc/ada/s-osinte-linux-hppa.ads Thu Apr 7 20:03:51 2005 --- gcc-4.0.3/gcc/ada/s-osinte-linux-hppa.ads Fri Jan 20 14:34:29 2006 *************** private *** 508,514 **** lock : lock_array; end record; pragma Convention (C, atomic_lock_t); ! for atomic_lock_t'Alignment use 8 * 16; type struct_pthread_fast_lock is record spinlock : atomic_lock_t; --- 508,517 ---- lock : lock_array; end record; pragma Convention (C, atomic_lock_t); ! -- ??? Alignment should be 16 but this is larger than BIGGEST_ALIGNMENT. ! -- This causes an erroneous pointer value to sometimes be passed to free ! -- during deallocation. See PR ada/24533 for more details. ! for atomic_lock_t'Alignment use 8; type struct_pthread_fast_lock is record spinlock : atomic_lock_t; diff -Nrcpad gcc-4.0.2/gcc/ada/trans.c gcc-4.0.3/gcc/ada/trans.c *** gcc-4.0.2/gcc/ada/trans.c Thu Mar 17 19:53:07 2005 --- gcc-4.0.3/gcc/ada/trans.c Thu Nov 10 11:33:55 2005 *************** Subprogram_Body_to_gnu (Node_Id gnat_nod *** 1470,1478 **** gnu_retval = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_retval); add_stmt_with_node ! (build1 (RETURN_EXPR, void_type_node, ! build2 (MODIFY_EXPR, TREE_TYPE (gnu_retval), ! DECL_RESULT (current_function_decl), gnu_retval)), gnat_node); gnat_poplevel (); gnu_result = end_stmt_group (); --- 1470,1476 ---- gnu_retval = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_retval); add_stmt_with_node ! (build_return_expr (DECL_RESULT (current_function_decl), gnu_retval), gnat_node); gnat_poplevel (); gnu_result = end_stmt_group (); *************** call_to_gnu (Node_Id gnat_node, tree *gn *** 1678,1687 **** } /* Set up to move the copy back to the original. */ ! gnu_temp = build2 (MODIFY_EXPR, TREE_TYPE (gnu_copy), ! gnu_copy, gnu_actual); annotate_with_node (gnu_temp, gnat_actual); append_to_statement_list (gnu_temp, &gnu_after_list); } } --- 1676,1688 ---- } /* Set up to move the copy back to the original. */ ! gnu_temp = build_binary_op (MODIFY_EXPR, NULL_TREE, ! gnu_copy, gnu_actual); annotate_with_node (gnu_temp, gnat_actual); append_to_statement_list (gnu_temp, &gnu_after_list); + + /* Account for next statement just below. */ + gnu_name = gnu_actual; } } *************** gnat_to_gnu (Node_Id gnat_node) *** 3500,3507 **** tree gnu_ret_val = NULL_TREE; /* The place to put the return value. */ tree gnu_lhs; - /* Avoid passing error_mark_node to RETURN_EXPR. */ - gnu_result = NULL_TREE; /* 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 --- 3501,3506 ---- *************** gnat_to_gnu (Node_Id gnat_node) *** 3607,3624 **** } } } ! ! if (gnu_ret_val) ! gnu_result = build2 (MODIFY_EXPR, TREE_TYPE (gnu_ret_val), ! gnu_lhs, gnu_ret_val); if (TYPE_RETURNS_BY_TARGET_PTR_P (gnu_subprog_type)) { add_stmt_with_node (gnu_result, gnat_node); ! gnu_result = NULL_TREE; } ! gnu_result = build1 (RETURN_EXPR, void_type_node, gnu_result); } break; --- 3606,3625 ---- } } } ! else ! /* If the Ada subprogram is a regular procedure, just return. */ ! gnu_lhs = NULL_TREE; if (TYPE_RETURNS_BY_TARGET_PTR_P (gnu_subprog_type)) { + if (gnu_ret_val) + gnu_result = build_binary_op (MODIFY_EXPR, NULL_TREE, + gnu_lhs, gnu_ret_val); add_stmt_with_node (gnu_result, gnat_node); ! gnu_lhs = NULL_TREE; } ! gnu_result = build_return_expr (gnu_lhs, gnu_ret_val); } break; diff -Nrcpad gcc-4.0.2/gcc/ada/utils2.c gcc-4.0.3/gcc/ada/utils2.c *** gcc-4.0.2/gcc/ada/utils2.c Thu Mar 17 15:35:04 2005 --- gcc-4.0.3/gcc/ada/utils2.c Fri Oct 21 15:47:47 2005 *************** build_cond_expr (tree result_type, tree *** 1373,1380 **** return result; } - /* Build a CALL_EXPR to call FUNDECL with one argument, ARG. Return the CALL_EXPR. */ --- 1373,1422 ---- return result; } + /* Similar, but for RETURN_EXPR. If RESULT_DECL is non-zero, build + a RETURN_EXPR around the assignment of RET_VAL to RESULT_DECL. + If RESULT_DECL is zero, build a bare RETURN_EXPR. */ + + tree + build_return_expr (tree result_decl, tree ret_val) + { + tree result_expr; + + if (result_decl) + { + /* The gimplifier explicitly enforces the following invariant: + + RETURN_EXPR + | + MODIFY_EXPR + / \ + / \ + RESULT_DECL ... + + As a consequence, type-homogeneity dictates that we use the type + of the RESULT_DECL as the operation type. */ + + tree operation_type = TREE_TYPE (result_decl); + + /* Convert the right operand to the operation type. Note that + it's the same transformation as in the MODIFY_EXPR case of + build_binary_op with the additional guarantee that the type + cannot involve a placeholder, since otherwise the function + would use the "target pointer" return mechanism. */ + + if (operation_type != TREE_TYPE (ret_val)) + ret_val = convert (operation_type, ret_val); + + result_expr + = build2 (MODIFY_EXPR, operation_type, result_decl, ret_val); + } + else + result_expr = NULL_TREE; + + return build1 (RETURN_EXPR, void_type_node, result_expr); + } + /* Build a CALL_EXPR to call FUNDECL with one argument, ARG. Return the CALL_EXPR. */ diff -Nrcpad gcc-4.0.2/libada/ChangeLog gcc-4.0.3/libada/ChangeLog *** gcc-4.0.2/libada/ChangeLog Wed Sep 21 03:57:43 2005 --- gcc-4.0.3/libada/ChangeLog Thu Mar 9 20:45:00 2006 *************** *** 1,3 **** --- 1,7 ---- + 2006-03-09 Release Manager + + * GCC 4.0.3 released. + 2005-09-20 Release Manager * GCC 4.0.2 released.