Before this commit, a GNAT compiled with assertions would crash when
attempting to emit CUDA symbols in ALI files for spark_mode/ghost
packages, whose content is a single null statement.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* lib-writ.adb (Output_CUDA_Symbols): Check for null packages.
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -403,7 +403,9 @@ package body Lib.Writ is
Kernel_Elm : Elmt_Id;
Kernel : Entity_Id;
begin
- if not Enable_CUDA_Expansion then
+ if not Enable_CUDA_Expansion
+ or else Nkind (Unit_Id) = N_Null_Statement
+ then
return;
end if;
Spec_Id := (if Nkind (Unit_Id) = N_Package_Body