diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-04 23:04:18 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-04 23:04:18 +0000 |
commit | d85a20139d881d9d1adab64ffc7305cb3ae98e2a (patch) | |
tree | 0f4ef35ecb306a63e1426bcc2ec3b362210eccfe /gcc/ada | |
parent | 4d4ec3c86cac3f21e5908f762285a995b69dd4e2 (diff) | |
parent | 7d500d30a2205a6e6e6783a4b92cc38d66f3b70b (diff) | |
download | gcc-d85a20139d881d9d1adab64ffc7305cb3ae98e2a.tar.gz |
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@202265 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 46 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/Make-lang.in | 10 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/Makefile.in | 6 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 22 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/misc.c | 4 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 68 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 2 | ||||
-rw-r--r-- | gcc/ada/sigtramp-ppcvxw.c | 2 | ||||
-rw-r--r-- | gcc/ada/terminals.c | 2 |
9 files changed, 126 insertions, 36 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5db69aaa680..61fd991bef2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,49 @@ +2013-09-01 Eric Botcazou <ebotcazou@adacore.com> + Iain Sandoe <iain@codesourcery.com> + + PR ada/58239 + * gcc-interface/Makefile.in (GCC_LINK_FLAGS): Add -static-libstdc++. + (GCC_LINK): Use CXX instead of CC. + * gcc-interface/Make-lang.in (CXX_LFLAGS): New. + (ADA_TOOLS_FLAGS_TO_PASS): Pass CXX, and CXX_LFLAGS for native. + +2013-08-13 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/decl.c (gnat_to_gnu_entity): Do not bother about alias + sets of derived types in ASIS mode. + +2013-08-13 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/decl.c (gnat_to_gnu_entity): Replace True with true. + (is_cplusplus_method): Likewise, and False with false. + (components_need_strict_alignment): Likewise. + * gcc-interface/misc.c (gnat_init_gcc_fp): Likewise. + * gcc-interface/trans.c (Loop_Statement_to_gnu): Likewise. + (Handled_Sequence_Of_Statements_to_gnu): Likewise. + (add_cleanup): Likewise. + (Sloc_to_locus1): Likewise. + (Sloc_to_locus): Likewise. + (set_expr_location_from_node): Likewise. + * gcc-interface/utils.c (potential_alignment_gap): Likewise. + +2013-08-13 Thomas Quinot <quinot@adacore.com> + + * gcc-interface/trans.c (set_end_locus_from_node): Clear column info + for the end_locus of a block if it does not come from an End_Label. + +2013-08-13 Thomas Quinot <quinot@adacore.com> + + * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If + there is no End_Label, attach cleanup actions to the sloc of the HSS + node instead. + (Exception_Handler_to_gnu_zcx): Associate cleanup actions with the sloc + of the handler itself. + (add_cleanup): Clear column information in sloc of cleanup actions. + (Sloc_to_locus1): New static function. + (Sloc_to_locus): Call it. + (set_expr_location_from_node1): New static function. + (set_expr_location_from_node): Call it. + 2013-08-13 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/trans.c (Call_to_gnu): Deal with specific conditional diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index 4fed34fc524..93250da561c 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -111,6 +111,12 @@ ada: gnat1$(exeext) gnatbind$(exeext) # Tell GNU Make to ignore these, if they exist. .PHONY: ada +CXX_LFLAGS = \ + -B../../../$(target_noncanonical)/libstdc++-v3/src/.libs \ + -B../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs \ + -L../../../$(target_noncanonical)/libstdc++-v3/src/.libs \ + -L../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs + # There are too many Ada sources to check against here. Let's # always force the recursive make. ifeq ($(build), $(host)) @@ -119,6 +125,7 @@ ifeq ($(build), $(host)) # tree. ADA_TOOLS_FLAGS_TO_PASS=\ CC="../../xgcc -B../../" \ + CXX="../../xg++ -B../../ $(CXX_LFLAGS)" \ $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \ ADA_INCLUDES="-I- -I../rts" \ GNATMAKE="../../gnatmake" \ @@ -136,6 +143,7 @@ ifeq ($(build), $(host)) ADA_TOOLS_FLAGS_TO_PASS=\ CC="$(CC)" \ + CXX="$(CXX)" \ $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \ ADA_INCLUDES="-I$(RTS_DIR)../adainclude -I$(RTS_DIR)" \ GNATMAKE="gnatmake" \ @@ -158,6 +166,7 @@ else # built runtime. ADA_TOOLS_FLAGS_TO_PASS=\ CC="$(CC)" \ + CXX="$(CXX)" \ $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \ ADA_INCLUDES="-I../rts" \ GNATMAKE="$(GNATMAKE_FOR_HOST)" \ @@ -172,6 +181,7 @@ else endif ADA_TOOLS_FLAGS_TO_PASS=\ CC="$(CC)" \ + CXX="$(CXX)" \ $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \ ADA_INCLUDES="-I$(RTS_DIR)../adainclude -I$(RTS_DIR)" \ GNATMAKE="$(GNATMAKE_FOR_HOST)" \ diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index bdaa29b8a8d..0c4057c1019 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -198,7 +198,7 @@ RTSDIR = rts$(subst /,_,$(MULTISUBDIR)) # Link flags used to build gnat tools. By default we prefer to statically # link with libgcc to avoid a dependency on shared libgcc (which is tricky # to deal with as it may conflict with the libgcc provided by the system). -GCC_LINK_FLAGS=-static-libgcc +GCC_LINK_FLAGS=-static-libstdc++ -static-libgcc # End of variables for you to override. @@ -2275,7 +2275,7 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),) GMEM_LIB = gmemlib LIBRARY_VERSION := $(LIB_VERSION) soext = .dylib - GCC_LINK_FLAGS= + GCC_LINK_FLAGS=-static-libstdc++ endif # ARM Nucleus @@ -2397,7 +2397,7 @@ TOOLS_FLAGS_TO_PASS= \ "GNATLINK=$(GNATLINK)" \ "GNATBIND=$(GNATBIND)" -GCC_LINK=$(CC) $(GCC_LINK_FLAGS) $(ADA_INCLUDES) +GCC_LINK=$(CXX) $(GCC_LINK_FLAGS) $(ADA_INCLUDES) # Build directory for the tools. Let's copy the target-dependent # sources using the same mechanism as for gnatlib. The other sources are diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 4f58abc1d82..40276a0ef42 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -4830,7 +4830,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) if (is_type && (!gnu_decl || this_made_decl)) { /* Process the attributes, if not already done. Note that the type is - already defined so we cannot pass True for IN_PLACE here. */ + already defined so we cannot pass true for IN_PLACE here. */ process_attributes (&gnu_type, &attr_list, false, gnat_entity); /* Tell the middle-end that objects of tagged types are guaranteed to @@ -5153,7 +5153,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) to conflict with Comp2 and an alias set copy is required. The language rules ensure the parent type is already frozen here. */ - if (Is_Derived_Type (gnat_entity)) + if (Is_Derived_Type (gnat_entity) && !type_annotate_only) { tree gnu_parent_type = gnat_to_gnu_type (Etype (gnat_entity)); relate_alias_sets (gnu_type, gnu_parent_type, @@ -5449,26 +5449,26 @@ bool is_cplusplus_method (Entity_Id gnat_entity) { if (Convention (gnat_entity) != Convention_CPP) - return False; + return false; /* This is the main case: C++ method imported as a primitive operation. */ if (Is_Dispatching_Operation (gnat_entity)) - return True; + return true; /* A thunk needs to be handled like its associated primitive operation. */ if (Is_Subprogram (gnat_entity) && Is_Thunk (gnat_entity)) - return True; + return true; /* C++ classes with no virtual functions can be imported as limited record types, but we need to return true for the constructors. */ if (Is_Constructor (gnat_entity)) - return True; + return true; /* This is set on the E_Subprogram_Type built for a dispatching call. */ if (Is_Dispatch_Table_Entity (gnat_entity)) - return True; + return true; - return False; + return false; } /* Finalize the processing of From_With_Type incomplete types. */ @@ -6727,13 +6727,13 @@ components_need_strict_alignment (Node_Id component_list) Entity_Id gnat_field = Defining_Entity (component_decl); if (Is_Aliased (gnat_field)) - return True; + return true; if (Strict_Alignment (Etype (gnat_field))) - return True; + return true; } - return False; + return false; } /* Return true if TYPE is a type with variable size or a padding type with a diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 5978c9e5099..a82f6fd8f82 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -385,13 +385,13 @@ void gnat_init_gcc_fp (void) { /* Disable FP optimizations that ignore the signedness of zero if - S'Signed_Zeros is True, but don't override the user if not. */ + S'Signed_Zeros is true, but don't override the user if not. */ if (Signed_Zeros_On_Target) flag_signed_zeros = 1; else if (!global_options_set.x_flag_signed_zeros) flag_signed_zeros = 0; - /* Assume that FP operations can trap if S'Machine_Overflow is True, + /* Assume that FP operations can trap if S'Machine_Overflow is true, but don't override the user if not. ??? Alpha/VMS enables FP traps without declaring it. */ diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index a20078993c9..91a5332de4e 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -257,6 +257,8 @@ static tree pos_to_constructor (Node_Id, tree, Entity_Id); static void validate_unchecked_conversion (Node_Id); static tree maybe_implicit_deref (tree); static void set_expr_location_from_node (tree, Node_Id); +static void set_expr_location_from_node1 (tree, Node_Id, bool); +static bool Sloc_to_locus1 (Source_Ptr, location_t *, bool); static bool set_end_locus_from_node (tree, Node_Id); static void set_gnu_expr_location_from_node (tree, Node_Id); static int lvalue_required_p (Node_Id, tree, bool, bool, bool); @@ -2719,7 +2721,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node) /* First, if we have computed a small number of invariant conditions for range checks applied to the iteration variable, then initialize these - conditions in front of the loop. Otherwise, leave them set to True. + conditions in front of the loop. Otherwise, leave them set to true. ??? The heuristics need to be improved, by taking into account the following datapoints: @@ -4471,6 +4473,10 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) tree gnu_result; tree gnu_expr; Node_Id gnat_temp; + /* Node providing the sloc for the cleanup actions. */ + Node_Id gnat_cleanup_loc_node = (Present (End_Label (gnat_node)) ? + End_Label (gnat_node) : + gnat_node); /* The GCC exception handling mechanism can handle both ZCX and SJLJ schemes and we have our own SJLJ mechanism. To call the GCC mechanism, we call @@ -4520,7 +4526,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) /* When we exit this block, restore the saved value. */ add_cleanup (build_call_n_expr (set_jmpbuf_decl, 1, gnu_jmpsave_decl), - End_Label (gnat_node)); + gnat_cleanup_loc_node); } /* If we are to call a function when exiting this block, add a cleanup @@ -4528,7 +4534,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) so we must register this cleanup after the EH cleanup just above. */ if (at_end) add_cleanup (build_call_n_expr (gnat_to_gnu (At_End_Proc (gnat_node)), 0), - End_Label (gnat_node)); + gnat_cleanup_loc_node); /* Now build the tree for the declarations and statements inside this block. If this is SJLJ, set our jmp_buf as the current buffer. */ @@ -4641,14 +4647,18 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) /* Now make the TRY_CATCH_EXPR for the block. */ gnu_result = build2 (TRY_CATCH_EXPR, void_type_node, gnu_inner_block, gnu_handlers); - /* Set a location. We need to find a uniq location for the dispatching + /* Set a location. We need to find a unique location for the dispatching code, otherwise we can get coverage or debugging issues. Try with the location of the end label. */ if (Present (End_Label (gnat_node)) && Sloc_to_locus (Sloc (End_Label (gnat_node)), &locus)) SET_EXPR_LOCATION (gnu_result, locus); else - set_expr_location_from_node (gnu_result, gnat_node); + /* Clear column information so that the exception handler of an + implicit transient block does not incorrectly inherit the slocs + of a decision, which would otherwise confuse control flow based + coverage analysis tools. */ + set_expr_location_from_node1 (gnu_result, gnat_node, true); } else gnu_result = gnu_inner_block; @@ -4843,9 +4853,10 @@ Exception_Handler_to_gnu_zcx (Node_Id gnat_node) add_stmt_with_node (build_call_n_expr (begin_handler_decl, 1, gnu_incoming_exc_ptr), gnat_node); - /* ??? We don't seem to have an End_Label at hand to set the location. */ + /* We don't have an End_Label at hand to set the location of the cleanup + actions, so we use that of the exception handler itself instead. */ add_cleanup (build_call_n_expr (end_handler_decl, 1, gnu_incoming_exc_ptr), - Empty); + gnat_node); add_stmt_list (Statements (gnat_node)); gnat_poplevel (); @@ -7397,13 +7408,15 @@ mark_visited (tree t) } /* Add GNU_CLEANUP, a cleanup action, to the current code group and - set its location to that of GNAT_NODE if present. */ + set its location to that of GNAT_NODE if present, but with column info + cleared so that conditional branches generated as part of the cleanup + code do not interfere with coverage analysis tools. */ static void add_cleanup (tree gnu_cleanup, Node_Id gnat_node) { if (Present (gnat_node)) - set_expr_location_from_node (gnu_cleanup, gnat_node); + set_expr_location_from_node1 (gnu_cleanup, gnat_node, true); append_to_statement_list (gnu_cleanup, ¤t_stmt_group->cleanups); } @@ -9018,10 +9031,11 @@ maybe_implicit_deref (tree exp) /* Convert SLOC into LOCUS. Return true if SLOC corresponds to a source code location and false if it doesn't. In the former case, set the Gigi global - variable REF_FILENAME to the simple debug file name as given by sinput. */ + variable REF_FILENAME to the simple debug file name as given by sinput. + If clear_column is true, set column information to 0. */ -bool -Sloc_to_locus (Source_Ptr Sloc, location_t *locus) +static bool +Sloc_to_locus1 (Source_Ptr Sloc, location_t *locus, bool clear_column) { if (Sloc == No_Location) return false; @@ -9035,7 +9049,7 @@ Sloc_to_locus (Source_Ptr Sloc, location_t *locus) { Source_File_Index file = Get_Source_File_Index (Sloc); Logical_Line_Number line = Get_Logical_Line_Number (Sloc); - Column_Number column = Get_Column_Number (Sloc); + Column_Number column = (clear_column ? 0 : Get_Column_Number (Sloc)); struct line_map *map = LINEMAPS_ORDINARY_MAP_AT (line_table, file - 1); /* We can have zero if pragma Source_Reference is in effect. */ @@ -9054,20 +9068,36 @@ Sloc_to_locus (Source_Ptr Sloc, location_t *locus) return true; } +/* Similar to the above, not clearing the column information. */ + +bool +Sloc_to_locus (Source_Ptr Sloc, location_t *locus) +{ + return Sloc_to_locus1 (Sloc, locus, false); +} + /* Similar to set_expr_location, but start with the Sloc of GNAT_NODE and don't do anything if it doesn't correspond to a source location. */ static void -set_expr_location_from_node (tree node, Node_Id gnat_node) +set_expr_location_from_node1 (tree node, Node_Id gnat_node, bool clear_column) { location_t locus; - if (!Sloc_to_locus (Sloc (gnat_node), &locus)) + if (!Sloc_to_locus1 (Sloc (gnat_node), &locus, clear_column)) return; SET_EXPR_LOCATION (node, locus); } +/* Similar to the above, not clearing the column information. */ + +static void +set_expr_location_from_node (tree node, Node_Id gnat_node) +{ + set_expr_location_from_node1 (node, gnat_node, false); +} + /* More elaborate version of set_expr_location_from_node to be used in more general contexts, for example the result of the translation of a generic GNAT node. */ @@ -9198,9 +9228,13 @@ set_end_locus_from_node (tree gnu_node, Node_Id gnat_node) gnat_node = Present (gnat_end_label) ? gnat_end_label : gnat_node; /* Some expanded subprograms have neither an End_Label nor a Sloc - attached. Notify that to callers. */ + attached. Notify that to callers. For a block statement with no + End_Label, clear column information, so that the tree for a + transient block does not receive the sloc of a source condition. */ - if (!Sloc_to_locus (Sloc (gnat_node), &end_locus)) + if (!Sloc_to_locus1 (Sloc (gnat_node), &end_locus, + No (gnat_end_label) && + (Nkind (gnat_node) == N_Block_Statement))) return false; switch (TREE_CODE (gnu_node)) diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 3e6bba4dd69..34edf87cf55 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -2572,7 +2572,7 @@ potential_alignment_gap (tree prev_field, tree curr_field, tree offset) if (!prev_field) return false; - /* If the previous field is a union type, then return False: The only + /* If the previous field is a union type, then return false: The only time when such a field is not the last field of the record is when there are other components at fixed positions after it (meaning there was a rep clause for every field), in which case we don't want the diff --git a/gcc/ada/sigtramp-ppcvxw.c b/gcc/ada/sigtramp-ppcvxw.c index 69baa1420df..e7b318fa9bf 100644 --- a/gcc/ada/sigtramp-ppcvxw.c +++ b/gcc/ada/sigtramp-ppcvxw.c @@ -6,7 +6,7 @@ * * * Asm Implementation File * * * - * Copyright (C) 2011-2012, Free Software Foundation, Inc. * + * Copyright (C) 2011-2013, 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/terminals.c b/gcc/ada/terminals.c index dfadca8d6a9..8672ca372b6 100644 --- a/gcc/ada/terminals.c +++ b/gcc/ada/terminals.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 2008-2012, AdaCore * + * Copyright (C) 2008-2013, AdaCore * * * * 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- * |