diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-05 21:34:24 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-05 21:34:24 +0000 |
commit | 2e171de466a2cfb7fe037aa11fb8803a93ad1916 (patch) | |
tree | 186673f49214bc2f410d4f333b9304a4f4c451c7 /gcc/ada | |
parent | 72214ac9ad7c4d3c189f0bd2327f3f3d3987533a (diff) | |
download | gcc-2e171de466a2cfb7fe037aa11fb8803a93ad1916.tar.gz |
2009-07-05 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r149262
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@149264 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 63 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/ada-tree.h | 59 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 16 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/lang-specs.h | 2 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 11 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils2.c | 25 | ||||
-rw-r--r-- | gcc/ada/init.c | 9 | ||||
-rw-r--r-- | gcc/ada/raise-gcc.c | 4 | ||||
-rw-r--r-- | gcc/ada/tracebak.c | 13 |
9 files changed, 150 insertions, 52 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b4c1dc080c6..a2ad9719619 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,66 @@ +2009-07-04 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + PR ada/40608 + * init.c (APPLE): Include <mach/mach_init.h>. + (__gnat_error_handler, APPLE): Add ATTRIBUTE_UNUSED marker. + +2009-07-04 Eric Botcazou <ebotcazou@adacore.com> + + * ada-tree.h (SET_TYPE_LANG_SPECIFIC): Rewrite. + (SET_DECL_LANG_SPECIFIC): Likewise. + (TYPE_RM_VALUE): New macro. + (SET_TYPE_RM_VALUE): Likewise. + (TYPE_RM_SIZE): Rewrite in terms of TYPE_RM_VALUE. + (TYPE_RM_MIN_VALUE): Likewise. + (TYPE_RM_MAX_VALUE): Likewise. + (SET_TYPE_RM_SIZE): Rewrite in terms of SET_TYPE_RM_VALUE. + (SET_TYPE_RM_MIN_VALUE): Likewise. + (SET_TYPE_RM_MAX_VALUE): Likewise. + * decl.c (gnat_to_gnu_entity) <E_Array_Subtype>: Remove kludge. + +2009-07-04 Laurent GUERBY <laurent@guerby.net> + + PR ada/40631 + * tracebak.c (__gnat_backtrace): Fix old-style definition. + +2009-07-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> + + * tracebak.c [i386 && sun] (IS_BAD_PTR): Use -1UL in comparison. + +2009-07-01 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + PR ada/40609 + * init.c (__gnat_error_handler, HP-UX): Add ATTRIBUTE_UNUSED marker to + ucontext argument. + +2009-07-01 Eric Botcazou <ebotcazou@adacore.com> + + * init.c (__gnat_error_handler, Solaris): Add ATTRIBUTE_UNUSED marker. + +2009-06-30 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/utils2.c (build_binary_op) <MODIFY_EXPR>: Do not use + the type of the left operand if it pads a self-referential type when + the right operand is a constructor. + + * gcc-interface/lang-specs.h: Fix copyright date. + +2009-06-30 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/decl.c: Include tree-inline.h. + (annotate_value) <CALL_EXPR>: Try to inline the call in the expression. + * gcc-interface/utils.c (max_size) <CALL_EXPR>: Likewise. + * gcc-interface/utils2.c: Include tree-inline. + (known_alignment) <CALL_EXPR>: Likewise. + +2009-06-30 Eric Botcazou <ebotcazou@adacore.com> + + * raise-gcc.c: Include dwarf2.h conditionally. + +2009-06-29 Tom Tromey <tromey@redhat.com> + + * raise-gcc.c: Include elf/dwarf2.h. + 2009-06-27 Laurent GUERBY <laurent@guerby.net> * tb-gcc.c (trace_callback): Add casts to silence warning. diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h index 38bc8620815..8d157224f29 100644 --- a/gcc/ada/gcc-interface/ada-tree.h +++ b/gcc/ada/gcc-interface/ada-tree.h @@ -40,19 +40,25 @@ struct GTY(()) lang_decl { tree t; }; #define GET_TYPE_LANG_SPECIFIC(NODE) \ (TYPE_LANG_SPECIFIC (NODE) ? TYPE_LANG_SPECIFIC (NODE)->t : NULL_TREE) -#define SET_TYPE_LANG_SPECIFIC(NODE, X) \ - (TYPE_LANG_SPECIFIC (NODE) \ - = (TYPE_LANG_SPECIFIC (NODE) \ - ? TYPE_LANG_SPECIFIC (NODE) : GGC_NEW (struct lang_type)))->t = (X) +#define SET_TYPE_LANG_SPECIFIC(NODE, X) \ +do { \ + tree tmp = (X); \ + if (!TYPE_LANG_SPECIFIC (NODE)) \ + TYPE_LANG_SPECIFIC (NODE) = GGC_NEW (struct lang_type); \ + TYPE_LANG_SPECIFIC (NODE)->t = tmp; \ +} while (0) /* Macros to get and set the tree in DECL_LANG_SPECIFIC. */ #define GET_DECL_LANG_SPECIFIC(NODE) \ (DECL_LANG_SPECIFIC (NODE) ? DECL_LANG_SPECIFIC (NODE)->t : NULL_TREE) -#define SET_DECL_LANG_SPECIFIC(NODE, X) \ - (DECL_LANG_SPECIFIC (NODE) \ - = (DECL_LANG_SPECIFIC (NODE) \ - ? DECL_LANG_SPECIFIC (NODE) : GGC_NEW (struct lang_decl)))->t = (X) +#define SET_DECL_LANG_SPECIFIC(NODE, X) \ +do { \ + tree tmp = (X); \ + if (!DECL_LANG_SPECIFIC (NODE)) \ + DECL_LANG_SPECIFIC (NODE) = GGC_NEW (struct lang_decl); \ + DECL_LANG_SPECIFIC (NODE)->t = tmp; \ +} while (0) /* Flags added to type nodes. */ @@ -184,6 +190,19 @@ struct GTY(()) lang_decl { tree t; }; /* For numerical types, this holds various RM-defined values. */ #define TYPE_RM_VALUES(NODE) TYPE_LANG_SLOT_1 (NUMERICAL_TYPE_CHECK (NODE)) +/* Macros to get and set the individual values in TYPE_RM_VALUES. */ +#define TYPE_RM_VALUE(NODE, N) \ + (TYPE_RM_VALUES (NODE) \ + ? TREE_VEC_ELT (TYPE_RM_VALUES (NODE), (N)) : NULL_TREE) + +#define SET_TYPE_RM_VALUE(NODE, N, X) \ +do { \ + tree tmp = (X); \ + if (!TYPE_RM_VALUES (NODE)) \ + TYPE_RM_VALUES (NODE) = make_tree_vec (3); \ + TREE_VEC_ELT (TYPE_RM_VALUES (NODE), (N)) = tmp; \ +} while (0) + /* For numerical types, this is the RM size of the type, aka its precision. There is a discrepancy between what is called precision here (and more generally throughout gigi) and what is called precision in the GCC type @@ -196,12 +215,8 @@ struct GTY(()) lang_decl { tree t; }; the optimizer can pretend that they simply don't exist. Therefore they must be within the range of values allowed by the precision in the GCC sense, hence TYPE_PRECISION be set to the Esize, not the RM size. */ -#define TYPE_RM_SIZE(NODE) \ - (TYPE_RM_VALUES (NODE) ? TREE_VEC_ELT (TYPE_RM_VALUES (NODE), 0) : NULL_TREE) -#define SET_TYPE_RM_SIZE(NODE, X) \ - TREE_VEC_ELT ((TYPE_RM_VALUES (NODE) \ - = (TYPE_RM_VALUES (NODE) \ - ? TYPE_RM_VALUES (NODE) : make_tree_vec (3))), 0) = (X) +#define TYPE_RM_SIZE(NODE) TYPE_RM_VALUE ((NODE), 0) +#define SET_TYPE_RM_SIZE(NODE, X) SET_TYPE_RM_VALUE ((NODE), 0, (X)) /* For numerical types, this is the RM lower bound of the type. There is again a discrepancy between this lower bound and the GCC lower bound, @@ -212,12 +227,8 @@ struct GTY(()) lang_decl { tree t; }; the optimizer can pretend that they simply don't exist. Therefore they must be within the range of values allowed by the lower bound in the GCC sense, hence the GCC lower bound be set to that of the base type. */ -#define TYPE_RM_MIN_VALUE(NODE) \ - (TYPE_RM_VALUES (NODE) ? TREE_VEC_ELT (TYPE_RM_VALUES (NODE), 1) : NULL_TREE) -#define SET_TYPE_RM_MIN_VALUE(NODE, X) \ - TREE_VEC_ELT ((TYPE_RM_VALUES (NODE) \ - = (TYPE_RM_VALUES (NODE) \ - ? TYPE_RM_VALUES (NODE) : make_tree_vec (3))), 1) = (X) +#define TYPE_RM_MIN_VALUE(NODE) TYPE_RM_VALUE ((NODE), 1) +#define SET_TYPE_RM_MIN_VALUE(NODE, X) SET_TYPE_RM_VALUE ((NODE), 1, (X)) /* For numerical types, this is the RM upper bound of the type. There is again a discrepancy between this upper bound and the GCC upper bound, @@ -228,12 +239,8 @@ struct GTY(()) lang_decl { tree t; }; the optimizer can pretend that they simply don't exist. Therefore they must be within the range of values allowed by the upper bound in the GCC sense, hence the GCC upper bound be set to that of the base type. */ -#define TYPE_RM_MAX_VALUE(NODE) \ - (TYPE_RM_VALUES (NODE) ? TREE_VEC_ELT (TYPE_RM_VALUES (NODE), 2) : NULL_TREE) -#define SET_TYPE_RM_MAX_VALUE(NODE, X) \ - TREE_VEC_ELT ((TYPE_RM_VALUES (NODE) \ - = (TYPE_RM_VALUES (NODE) \ - ? TYPE_RM_VALUES (NODE) : make_tree_vec (3))), 2) = (X) +#define TYPE_RM_MAX_VALUE(NODE) TYPE_RM_VALUE ((NODE), 2) +#define SET_TYPE_RM_MAX_VALUE(NODE, X) SET_TYPE_RM_VALUE ((NODE), 2, (X)) /* For numerical types, this is the lower bound of the type, i.e. the RM lower bound for language-defined types and the GCC lower bound for others. */ diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 48acbfbe3c1..42086128cd7 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -33,6 +33,7 @@ #include "ggc.h" #include "target.h" #include "expr.h" +#include "tree-inline.h" #include "ada.h" #include "types.h" @@ -2628,12 +2629,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) #endif } - /* ??? This is necessary to make sure that the container is - allocated with a null tree upfront; otherwise, it could - be allocated with an uninitialized tree that is accessed - before being set below. See ada-tree.h for details. */ - SET_TYPE_ACTUAL_BOUNDS (gnu_inner_type, NULL_TREE); - for (gnat_index = First_Index (gnat_entity); Present (gnat_index); gnat_index = Next_Index (gnat_index)) SET_TYPE_ACTUAL_BOUNDS @@ -7190,6 +7185,15 @@ annotate_value (tree gnu_size) case EQ_EXPR: tcode = Eq_Expr; break; case NE_EXPR: tcode = Ne_Expr; break; + case CALL_EXPR: + { + tree t = maybe_inline_call_in_expr (gnu_size); + if (t) + return annotate_value (t); + } + + /* Fall through... */ + default: return No_Uint; } diff --git a/gcc/ada/gcc-interface/lang-specs.h b/gcc/ada/gcc-interface/lang-specs.h index 1afba3706b4..e0c1be9e103 100644 --- a/gcc/ada/gcc-interface/lang-specs.h +++ b/gcc/ada/gcc-interface/lang-specs.h @@ -6,7 +6,7 @@ * * * C Header File * * * - * Copyright (C) 1992-2008, Free Software Foundation, Inc. * + * Copyright (C) 1992-2009, 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- * diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index a4d77a39c01..aa12eb77506 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -2333,10 +2333,15 @@ max_size (tree exp, bool max_p) case tcc_vl_exp: if (code == CALL_EXPR) { - tree *argarray; - int i, n = call_expr_nargs (exp); - gcc_assert (n > 0); + tree t, *argarray; + int n, i; + + t = maybe_inline_call_in_expr (exp); + if (t) + return max_size (t, max_p); + n = call_expr_nargs (exp); + gcc_assert (n > 0); argarray = (tree *) alloca (n * sizeof (tree)); for (i = 0; i < n; i++) argarray[i] = max_size (CALL_EXPR_ARG (exp, i), max_p); diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c index aab01f9b5d7..e60e5a093ae 100644 --- a/gcc/ada/gcc-interface/utils2.c +++ b/gcc/ada/gcc-interface/utils2.c @@ -31,6 +31,7 @@ #include "ggc.h" #include "flags.h" #include "output.h" +#include "tree-inline.h" #include "ada.h" #include "types.h" @@ -215,6 +216,15 @@ known_alignment (tree exp) this_alignment = expr_align (TREE_OPERAND (exp, 0)); break; + case CALL_EXPR: + { + tree t = maybe_inline_call_in_expr (exp); + if (t) + return known_alignment (t); + } + + /* Fall through... */ + default: /* For other pointer expressions, we assume that the pointed-to object is at least as aligned as the pointed-to type. Beware that we can @@ -697,9 +707,10 @@ build_binary_op (enum tree_code op_code, tree result_type, /* If we are copying between padded objects with compatible types, use the padded view of the objects, this is very likely more efficient. - Likewise for a padded that is assigned a constructor, in order to - avoid putting a VIEW_CONVERT_EXPR on the LHS. But don't do this if - we wouldn't have actually copied anything. */ + Likewise for a padded object that is assigned a constructor, if we + can convert the constructor to the inner type, to avoid putting a + VIEW_CONVERT_EXPR on the LHS. But don't do so if we wouldn't have + actually copied anything. */ else if (TREE_CODE (left_type) == RECORD_TYPE && TYPE_IS_PADDING_P (left_type) && TREE_CONSTANT (TYPE_SIZE (left_type)) @@ -709,9 +720,11 @@ build_binary_op (enum tree_code op_code, tree result_type, && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (right_operand, 0))) && gnat_types_compatible_p - (left_type, - TREE_TYPE (TREE_OPERAND (right_operand, 0)))) - || TREE_CODE (right_operand) == CONSTRUCTOR) + (left_type, + TREE_TYPE (TREE_OPERAND (right_operand, 0)))) + || (TREE_CODE (right_operand) == CONSTRUCTOR + && !CONTAINS_PLACEHOLDER_P + (DECL_SIZE (TYPE_FIELDS (left_type))))) && !integer_zerop (TYPE_SIZE (right_type))) operation_type = left_type; diff --git a/gcc/ada/init.c b/gcc/ada/init.c index d5c7cca43fc..3193dff00bb 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -441,7 +441,9 @@ __gnat_error_handler (int sig, siginfo_t *siginfo, void *ucontext); static void __gnat_error_handler - (int sig, siginfo_t *siginfo ATTRIBUTE_UNUSED, void *ucontext) + (int sig, + siginfo_t *siginfo ATTRIBUTE_UNUSED, + void *ucontext ATTRIBUTE_UNUSED) { struct Exception_Data *exception; const char *msg; @@ -1002,7 +1004,7 @@ __gnat_install_handler(void) static void __gnat_error_handler (int, siginfo_t *, ucontext_t *); static void -__gnat_error_handler (int sig, siginfo_t *sip, ucontext_t *uctx) +__gnat_error_handler (int sig, siginfo_t *sip, ucontext_t *cx ATTRIBUTE_UNUSED) { struct Exception_Data *exception; static int recurse = 0; @@ -2101,6 +2103,7 @@ __gnat_install_handler(void) #include <signal.h> #include <mach/mach_vm.h> +#include <mach/mach_init.h> #include <mach/vm_statistics.h> /* This must be in keeping with System.OS_Interface.Alternate_Stack_Size. */ @@ -2138,7 +2141,7 @@ __gnat_is_stack_guard (mach_vm_address_t addr) } static void -__gnat_error_handler (int sig, siginfo_t * si, void * uc) +__gnat_error_handler (int sig, siginfo_t * si, void * uc ATTRIBUTE_UNUSED) { struct Exception_Data *exception; const char *msg; diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c index 1d9efb93b7f..ca20709ddc8 100644 --- a/gcc/ada/raise-gcc.c +++ b/gcc/ada/raise-gcc.c @@ -96,7 +96,11 @@ __gnat_Unwind_ForcedUnwind (_Unwind_Exception *, void *, void *); #ifdef IN_RTS /* For eh personality routine */ +#if (__GNUC__ * 10 + __GNUC_MINOR__ > 44) +#include "elf/dwarf2.h" +#else #include "dwarf2.h" +#endif #include "unwind-dw2-fde.h" #include "unwind-pe.h" diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c index 63f93b37eb7..835b7a8d620 100644 --- a/gcc/ada/tracebak.c +++ b/gcc/ada/tracebak.c @@ -298,7 +298,7 @@ struct layout #include <windows.h> #define IS_BAD_PTR(ptr) (IsBadCodePtr((void *)ptr)) #elif defined (sun) -#define IS_BAD_PTR(ptr) ((unsigned long)ptr == -1) +#define IS_BAD_PTR(ptr) ((unsigned long)ptr == -1UL) #else #define IS_BAD_PTR(ptr) 0 #endif @@ -494,12 +494,11 @@ __gnat_backtrace (void **array, *------------------------------*/ int -__gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames) - void **array ATTRIBUTE_UNUSED; - int size ATTRIBUTE_UNUSED; - void *exclude_min ATTRIBUTE_UNUSED; - void *exclude_max ATTRIBUTE_UNUSED; - int skip_frames ATTRIBUTE_UNUSED; +__gnat_backtrace (void **array ATTRIBUTE_UNUSED, + int size ATTRIBUTE_UNUSED, + void *exclude_min ATTRIBUTE_UNUSED, + void *exclude_max ATTRIBUTE_UNUSED, + int skip_frames ATTRIBUTE_UNUSED) { return 0; } |