]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix incorrect SLOC on instruction
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 21 May 2021 08:26:50 +0000 (10:26 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Fri, 21 May 2021 08:28:36 +0000 (10:28 +0200)
This puts the missing SLOC on a statement generated by a return.

gcc/ada/
* 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.

gcc/ada/gcc-interface/trans.c

index 5a55ca4f29ef3fb0139bd634236e58771bb37b26..8d63d03079f96a1e1f92f3e082e9cb7ddbc12f17 100644 (file)
@@ -7525,8 +7525,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 ());