From: Eric Botcazou Date: Fri, 30 Aug 2019 14:26:20 +0000 (+0000) Subject: * gcc-interface/trans.c (Attribute_to_gnu) : Add assertion. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=da81cc570f27e78f71fed25d3c21a1d7d7f3ed66;p=gcc.git * gcc-interface/trans.c (Attribute_to_gnu) : Add assertion. From-SVN: r275187 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 923f4744a7b..af3db1d6377 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2019-08-30 Eric Botcazou + + * gcc-interface/trans.c (Attribute_to_gnu) : Add assertion. + 2019-08-30 Eric Botcazou * gcc-interface/gigi.h (gigi_checking_assert): New macro. diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index f21b9a84d94..bd861f350c1 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -2351,6 +2351,9 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) gnu_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_type))); } + /* The type must be frozen at this point. */ + gcc_assert (COMPLETE_TYPE_P (gnu_type)); + /* If we're looking for the size of a field, return the field size. */ if (TREE_CODE (gnu_prefix) == COMPONENT_REF) gnu_result = DECL_SIZE (TREE_OPERAND (gnu_prefix, 1));