* [Ada] Fix incorrect SLOC on instruction
@ 2021-05-21 8:29 Eric Botcazou
0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2021-05-21 8:29 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 379 bytes --]
This puts the missing SLOC on a statement generated by a return.
Tested on x86-64/Linux, applied on the mainline, 11 and 10 branches.
2021-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (gnat_to_gnu) <N_Simple_Return_Statement>:
Put a SLOC on the assignment from the return value to the return
object in the copy-in/copy-out case.
--
Eric Botcazou
[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 633 bytes --]
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 9aeaf038118..f5686475698 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -7624,8 +7624,10 @@ gnat_to_gnu (Node_Id gnat_node)
if (gnu_return_label_stack->last ())
{
if (gnu_ret_val)
- add_stmt (build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_ret_obj,
- gnu_ret_val));
+ add_stmt_with_node (build_binary_op (MODIFY_EXPR,
+ NULL_TREE, gnu_ret_obj,
+ gnu_ret_val),
+ gnat_node);
gnu_result = build1 (GOTO_EXPR, void_type_node,
gnu_return_label_stack->last ());
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-21 8:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 8:29 [Ada] Fix incorrect SLOC on instruction Eric Botcazou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).