aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-08-20 10:34:45 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-09-03 10:16:42 +0200
commit9ba7262c8de0a96e85cc1ad05e2c3666228c74e8 (patch)
tree24787eaaa16ed13fb405f65c4a52cec6965169e8 /gcc/ada
parentb3f6a7909149a5eff2b9e2a5d28439cccd7902df (diff)
downloadgcc-9ba7262c8de0a96e85cc1ad05e2c3666228c74e8.zip
gcc-9ba7262c8de0a96e85cc1ad05e2c3666228c74e8.tar.gz
gcc-9ba7262c8de0a96e85cc1ad05e2c3666228c74e8.tar.bz2
ada: Fix internal error on pragma pack with discriminated record component
When updating the size after making a packable type in gnat_to_gnu_field, we fail to clear it again when it is not constant. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_field): Clear again gnu_size after updating it if it is not constant.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/gcc-interface/decl.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 398e015..655ba0b 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -7686,6 +7686,8 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed,
gnu_field_type = gnu_packable_type;
if (!gnu_size)
gnu_size = rm_size (gnu_field_type);
+ if (TREE_CODE (gnu_size) != INTEGER_CST)
+ gnu_size = NULL_TREE;
}
}