aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-08-01 16:45:26 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-08-01 16:45:26 +0200
commit9a30c7c4092fa2e7f46ee54883404a3fe34f2919 (patch)
tree514c0aecb2430f2b39147e8bf572fd6c5dc59617 /gcc/ada/gcc-interface/trans.c
parent88b1a3221d1a03211d78dec931d0cc8d84b180cb (diff)
downloadgcc-9a30c7c4092fa2e7f46ee54883404a3fe34f2919.zip
gcc-9a30c7c4092fa2e7f46ee54883404a3fe34f2919.tar.gz
gcc-9a30c7c4092fa2e7f46ee54883404a3fe34f2919.tar.bz2
[multiple changes]
2014-08-01 Olivier Hainque <hainque@adacore.com> * gcc-interface/Make-lang.in (ADA_TOOLS_FLAGS_TO_PASS, native): use $(CXX) instead of ../../xg++ to feed CXX. (CXX_LFLAGS): Remove. Now unused as the proper flags are expected to be included in the CXX variable. 2014-08-01 Pierre-Marie Derodat <derodat@adacore.com> * gcc-interface/decl.c (elaborate_expression_1): Return the new variable when debug info is needed and the expression is not constant. Tag as external only new variables that are global. (gnat_to_gnu_entity): Call it after the GNU declaration is saved. * gcc-interface/trans.c (Attribute_to_gnu): Do not cache attributes for IN array parameters when their actual subtype needs debug info. (Compilation_Unit_to_gnu): Call it to process all remaining nodes. * gcc-interface/gigi.h (process_deferred_decl_context): New. * gcc-interface/utils.c (gnat_write_global_declarations): Do not emit debug info for ignored global declarations. (struct deferred_decl_context_node, add_deferred_decl_context, add_deferred_type_context, compute_deferred_decl_context, defer_or_set_type_context, deferred_decl_context_queue, get_debug_scope, get_global_context, process_deferred_decl_context): New. (gnat_pushdecl): Re-implement the DECL_CONTEXT and TYPE_CONTEXT computation machinery to rely on the GNAT Scope attribute. 2014-08-01 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/utils2.c (build_simple_component_ref): Add guard. From-SVN: r213482
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 64e428a..3323a56 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -1975,8 +1975,16 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
gcc_assert (TREE_CODE (gnu_type) == ARRAY_TYPE);
/* When not optimizing, look up the slot associated with the parameter
- and the dimension in the cache and create a new one on failure. */
- if (!optimize && Present (gnat_param))
+ and the dimension in the cache and create a new one on failure.
+ Don't do this when the actual subtype needs debug info (this happens
+ with -gnatD): in elaborate_expression_1, we create variables that
+ hold the bounds, so caching attributes isn't very interesting and
+ causes dependency issues between these variables and cached
+ expressions. */
+ if (!optimize
+ && Present (gnat_param)
+ && !(Present (Actual_Subtype (gnat_param))
+ && Needs_Debug_Info (Actual_Subtype (gnat_param))))
{
FOR_EACH_VEC_SAFE_ELT (f_parm_attr_cache, i, pa)
if (pa->id == gnat_param && pa->dim == Dimension)
@@ -4978,6 +4986,9 @@ Compilation_Unit_to_gnu (Node_Id gnat_node)
stabilization of the renamed entities may create SAVE_EXPRs which
have been tied to a specific elaboration routine just above. */
invalidate_global_renaming_pointers ();
+
+ /* Force the processing for all nodes that remain in the queue. */
+ process_deferred_decl_context (true);
}
/* Subroutine of gnat_to_gnu to translate gnat_node, an N_Raise_xxx_Error,