aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2020-05-09 22:26:25 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2020-05-09 22:26:25 +0200
commit40bd5a536257aabc0f3899d661debc13dee18d75 (patch)
treecc8cb2e0963bc489ff841d475e35652536c79a93 /gcc/ada/gcc-interface
parentad00a297ec4236b327430c171dfbe7587901ffd7 (diff)
downloadgcc-40bd5a536257aabc0f3899d661debc13dee18d75.zip
gcc-40bd5a536257aabc0f3899d661debc13dee18d75.tar.gz
gcc-40bd5a536257aabc0f3899d661debc13dee18d75.tar.bz2
Fix missing back-annotation for Out parameter
This happens when it is passed by copy and not passed in. * gcc-interface/decl.c (gnat_to_gnu_param): Also back-annotate the mechanism in the case of an Out parameter only passed by copy-out.
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/decl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 9c1acd9..ec9cc38 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -5447,7 +5447,10 @@ gnat_to_gnu_param (Entity_Id gnat_param, tree gnu_param_type, bool first,
&& (!type_requires_init_of_formal (Etype (gnat_param))
|| Is_Init_Proc (gnat_subprog)
|| by_return))
- return gnu_param_type;
+ {
+ Set_Mechanism (gnat_param, By_Copy);
+ return gnu_param_type;
+ }
gnu_param = create_param_decl (gnu_param_name, gnu_param_type);
TREE_READONLY (gnu_param) = ro_param || by_ref || by_component_ptr;