aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Squirek <squirek@adacore.com>2022-06-10 12:16:17 +0000
committerPierre-Marie de Rodat <derodat@adacore.com>2022-07-06 13:29:47 +0000
commit614c45555a11a658f0c9639afb67d1d4bbb3454f (patch)
tree4d6e3a2ae7300e5931fa42213931aa39fd13c94a
parent405ebd743d392d2b0afd384e0955e3922e388ca9 (diff)
downloadgcc-614c45555a11a658f0c9639afb67d1d4bbb3454f.zip
gcc-614c45555a11a658f0c9639afb67d1d4bbb3454f.tar.gz
gcc-614c45555a11a658f0c9639afb67d1d4bbb3454f.tar.bz2
[Ada] Incorrect emptying of CUDA global subprograms
This patch corrects an error in the compiler whereby no Corresponding_Spec was set for emptied CUDA global subprograms - leading to a malformed tree. gcc/ada/ * gnat_cuda.adb (Empty_CUDA_Global_Subprogram): Set Specification and Corresponding_Spec to match the original Kernel_Body.
-rw-r--r--gcc/ada/gnat_cuda.adb9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ada/gnat_cuda.adb b/gcc/ada/gnat_cuda.adb
index 44394b7..3391263 100644
--- a/gcc/ada/gnat_cuda.adb
+++ b/gcc/ada/gnat_cuda.adb
@@ -165,17 +165,20 @@ package body GNAT_CUDA is
Kernel_Elm := First_Elmt (Kernels);
while Present (Kernel_Elm) loop
- Kernel := Node (Kernel_Elm);
+ Kernel := Node (Kernel_Elm);
Kernel_Body := Subprogram_Body (Kernel);
- Loc := Sloc (Kernel_Body);
+ Loc := Sloc (Kernel_Body);
Null_Body := Make_Subprogram_Body (Loc,
- Specification => Subprogram_Specification (Kernel),
+ Specification => Specification (Kernel_Body),
Declarations => New_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Make_Null_Statement (Loc))));
+ Set_Corresponding_Spec (Null_Body,
+ Corresponding_Spec (Kernel_Body));
+
Rewrite (Kernel_Body, Null_Body);
Next_Elmt (Kernel_Elm);