Index: misc.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/ada/misc.c,v retrieving revision 1.94 diff -u -p -r1.94 misc.c --- misc.c 24 Nov 2004 19:45:06 -0000 1.94 +++ misc.c 7 Dec 2004 17:22:38 -0000 @@ -94,7 +94,6 @@ static bool gnat_post_options (const ch static HOST_WIDE_INT gnat_get_alias_set (tree); static void gnat_print_decl (FILE *, tree, int); static void gnat_print_type (FILE *, tree, int); -static int gnat_types_compatible_p (tree, tree); static const char *gnat_printable_name (tree, int); static tree gnat_eh_runtime_type (tree); static int gnat_eh_type_covers (tree, tree); @@ -130,6 +129,8 @@ static tree gnat_type_max_size (tree); #define LANG_HOOKS_PUSHDECL lhd_return_tree #undef LANG_HOOKS_FINISH_INCOMPLETE_DECL #define LANG_HOOKS_FINISH_INCOMPLETE_DECL gnat_finish_incomplete_decl +#undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS +#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true #undef LANG_HOOKS_GET_ALIAS_SET #define LANG_HOOKS_GET_ALIAS_SET gnat_get_alias_set #undef LANG_HOOKS_EXPAND_EXPR @@ -142,8 +143,6 @@ static tree gnat_type_max_size (tree); #define LANG_HOOKS_PRINT_DECL gnat_print_decl #undef LANG_HOOKS_PRINT_TYPE #define LANG_HOOKS_PRINT_TYPE gnat_print_type -#undef LANG_HOOKS_TYPES_COMPATIBLE_P -#define LANG_HOOKS_TYPES_COMPATIBLE_P gnat_types_compatible_p #undef LANG_HOOKS_TYPE_MAX_SIZE #define LANG_HOOKS_TYPE_MAX_SIZE gnat_type_max_size #undef LANG_HOOKS_DECL_PRINTABLE_NAME @@ -554,27 +553,6 @@ gnat_print_type (FILE *file, tree node, } } -/* We consider two types compatible if they have the same main variant, - but we also consider two array types compatible if they have the same - component type and bounds. - - ??? We may also want to generalize to considering lots of integer types - compatible, but we need to understand the effects of alias sets first. */ - -static int -gnat_types_compatible_p (tree x, tree y) -{ - if (TREE_CODE (x) == ARRAY_TYPE && TREE_CODE (y) == ARRAY_TYPE - && gnat_types_compatible_p (TREE_TYPE (x), TREE_TYPE (y)) - && operand_equal_p (TYPE_MIN_VALUE (TYPE_DOMAIN (x)), - TYPE_MIN_VALUE (TYPE_DOMAIN (y)), 0) - && operand_equal_p (TYPE_MAX_VALUE (TYPE_DOMAIN (x)), - TYPE_MAX_VALUE (TYPE_DOMAIN (y)), 0)) - return 1; - else - return TYPE_MAIN_VARIANT (x) == TYPE_MAIN_VARIANT (y); -} - static const char * gnat_printable_name (tree decl, int verbosity) { Index: adaint.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/ada/adaint.h,v retrieving revision 1.20 diff -u -p -r1.20 adaint.h --- adaint.h 19 Nov 2004 10:54:33 -0000 1.20 +++ adaint.h 7 Dec 2004 17:22:38 -0000 @@ -78,6 +78,8 @@ extern OS_Time __gnat_file_time_fd extern void __gnat_set_file_time_name (char *, time_t); extern void __gnat_get_env_value_ptr (char *, int *, char **); +extern int __gnat_dup (int); +extern int __gnat_dup2 (int, int); extern int __gnat_file_exists (char *); extern int __gnat_is_regular_file (char *); extern int __gnat_is_absolute_path (char *,int); Index: trans.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/ada/trans.c,v retrieving revision 1.83 diff -u -p -r1.83 trans.c --- trans.c 19 Nov 2004 10:54:52 -0000 1.83 +++ trans.c 7 Dec 2004 17:22:38 -0000 @@ -1621,7 +1621,9 @@ call_to_gnu (Node_Id gnat_node, tree *gn gnat_formal = Next_Formal_With_Extras (gnat_formal), gnat_actual = Next_Actual (gnat_actual)) { - tree gnu_formal_type = gnat_to_gnu_type (Etype (gnat_formal)); + tree gnu_formal + = (present_gnu_tree (gnat_formal) + ? get_gnu_tree (gnat_formal) : NULL_TREE); /* We treat a conversion between aggregate types as if it is an unchecked conversion. */ bool unchecked_convert_p @@ -1632,10 +1634,8 @@ call_to_gnu (Node_Id gnat_node, tree *gn ? Expression (gnat_actual) : gnat_actual); tree gnu_name = gnat_to_gnu (gnat_name); tree gnu_name_type = gnat_to_gnu_type (Etype (gnat_name)); - tree gnu_formal - = (present_gnu_tree (gnat_formal) - ? get_gnu_tree (gnat_formal) : NULL_TREE); tree gnu_actual; + tree gnu_formal_type; /* If it's possible we may need to use this expression twice, make sure than any side-effects are handled via SAVE_EXPRs. Likewise if we need @@ -1739,9 +1739,6 @@ call_to_gnu (Node_Id gnat_node, tree *gn gnu_actual = convert (gnat_to_gnu_type (Etype (gnat_actual)), gnu_actual); - if (TREE_CODE (gnu_actual) != SAVE_EXPR) - gnu_actual = convert (gnu_formal_type, gnu_actual); - /* If we have not saved a GCC object for the formal, it means it is an OUT parameter not passed by reference and that does not need to be copied in. Otherwise, look at the PARM_DECL to see if it is passed by @@ -1856,9 +1853,7 @@ call_to_gnu (Node_Id gnat_node, tree *gn integer_zero_node), false); else - gnu_actual - = convert (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (gnu_formal)), - gnu_actual); + gnu_actual = convert (DECL_ARG_TYPE (gnu_formal), gnu_actual); } gnu_actual_list = tree_cons (NULL_TREE, gnu_actual, gnu_actual_list); @@ -2244,8 +2239,15 @@ Exception_Handler_to_gnu_sjlj (Node_Id g else if (Nkind (gnat_temp) == N_Identifier || Nkind (gnat_temp) == N_Expanded_Name) { - tree gnu_expr - = gnat_to_gnu_entity (Entity (gnat_temp), NULL_TREE, 0); + Entity_Id gnat_ex_id = Entity (gnat_temp); + tree gnu_expr; + + /* Exception may be a renaming. Recover original exception which is + the one elaborated and registered. */ + if (Present (Renamed_Object (gnat_ex_id))) + gnat_ex_id = Renamed_Object (gnat_ex_id); + + gnu_expr = gnat_to_gnu_entity (gnat_ex_id, NULL_TREE, 0); this_choice = build_binary_op