This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Set missing source location info


The gimplifier requires that source location info be present on every call 
expression; otherwise it itself puts the current source location.  Gigi was
not setting it in every occasion, which can lead to some annoying behavior of 
the 'next' debugger's command.

Fixed thusly, tested on x86_64-suse-linux, applied on the mainline.


2007-11-14  Eric Botcazou  <ebotcazou@adacore.com>

	* trans.c (call_to_gnu): Always set the source location on the call
	expression. ?If the function returns-by-target, also set it on the
	address expression.


-- 
Eric Botcazou
Index: trans.c
===================================================================
--- trans.c	(revision 130131)
+++ trans.c	(working copy)
@@ -2311,6 +2311,7 @@ call_to_gnu (Node_Id gnat_node, tree *gn
   gnu_subprog_call = build_call_list (TREE_TYPE (gnu_subprog_type),
 				      gnu_subprog_addr,
 				      nreverse (gnu_actual_list));
+  set_expr_location_from_node (gnu_subprog_call, gnat_node);
 
   /* If we return by passing a target, the result is the target after the
      call.  We must not emit the call directly here because this might be
@@ -2336,6 +2337,7 @@ call_to_gnu (Node_Id gnat_node, tree *gn
 
       tree gnu_target_address
 	= build_unary_op (ADDR_EXPR, NULL_TREE, gnu_target);
+      set_expr_location_from_node (gnu_target_address, gnat_node);
 
       gnu_result
 	= build2 (COMPOUND_EXPR, TREE_TYPE (gnu_target_address),
@@ -2491,10 +2493,7 @@ call_to_gnu (Node_Id gnat_node, tree *gn
 	  }
 	}
   else
-    {
-      set_expr_location_from_node (gnu_subprog_call, gnat_node);
-      append_to_statement_list (gnu_subprog_call, &gnu_before_list);
-    }
+    append_to_statement_list (gnu_subprog_call, &gnu_before_list);
 
   append_to_statement_list (gnu_after_list, &gnu_before_list);
   return gnu_before_list;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]