aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-06-02 11:11:40 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-06-02 11:11:40 +0000
commite812d4dd5df9befff0bc077349453e6126a8807d (patch)
tree5c09157db8861d050ecc205a2deefa265593408f /gcc/ada/gcc-interface/utils.c
parentfcf7081cf9b5f2ccbc5167806fb8e377f100efec (diff)
downloadgcc-e812d4dd5df9befff0bc077349453e6126a8807d.zip
gcc-e812d4dd5df9befff0bc077349453e6126a8807d.tar.gz
gcc-e812d4dd5df9befff0bc077349453e6126a8807d.tar.bz2
decl.c (gnat_to_gnu_entity): If this is not a definition...
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is not a definition, retrieve the expression only if it's a compile-time known value if we are just annotating types. * gcc-interface/utils.c (convert): Do not try to upcast properly for a conversion between tagged types in type_annotate_only mode. From-SVN: r261113
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 7de76637..d415f49 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -4631,9 +4631,12 @@ convert (tree type, tree expr)
etype)))
return build1 (VIEW_CONVERT_EXPR, type, expr);
- /* If we are converting between tagged types, try to upcast properly. */
+ /* If we are converting between tagged types, try to upcast properly.
+ But don't do it if we are just annotating types since tagged types
+ aren't fully laid out in this mode. */
else if (ecode == RECORD_TYPE && code == RECORD_TYPE
- && TYPE_ALIGN_OK (etype) && TYPE_ALIGN_OK (type))
+ && TYPE_ALIGN_OK (etype) && TYPE_ALIGN_OK (type)
+ && !type_annotate_only)
{
tree child_etype = etype;
do {