mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-27 22:03:57 +08:00
[Ada] Fix incorrect computation of Component_Size in ASIS mode
2018-10-09 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is not a definition, retrieve the expression in all cases even if we are just annotating types. * gcc-interface/trans.c (gnat_to_gnu): Also translate Size attribute for constrained types in this mode. From-SVN: r264983
This commit is contained in:
parent
005f870e91
commit
4b9e1bc781
@ -1,3 +1,11 @@
|
|||||||
|
2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
|
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If
|
||||||
|
this is not a definition, retrieve the expression in all cases
|
||||||
|
even if we are just annotating types.
|
||||||
|
* gcc-interface/trans.c (gnat_to_gnu): Also translate Size
|
||||||
|
attribute for constrained types in this mode.
|
||||||
|
|
||||||
2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
|
2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
* adaint.c (__gnat_get_executable_suffix_ptr): Add new line.
|
* adaint.c (__gnat_get_executable_suffix_ptr): Add new line.
|
||||||
|
@ -612,8 +612,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
|
|||||||
&& !No_Initialization (gnat_decl)
|
&& !No_Initialization (gnat_decl)
|
||||||
&& !Is_Dispatch_Table_Entity (gnat_entity)
|
&& !Is_Dispatch_Table_Entity (gnat_entity)
|
||||||
&& Present (gnat_temp = Expression (gnat_decl))
|
&& Present (gnat_temp = Expression (gnat_decl))
|
||||||
&& Nkind (gnat_temp) != N_Allocator
|
&& Nkind (gnat_temp) != N_Allocator)
|
||||||
&& (!type_annotate_only || Compile_Time_Known_Value (gnat_temp)))
|
|
||||||
gnu_expr = gnat_to_gnu_external (gnat_temp);
|
gnu_expr = gnat_to_gnu_external (gnat_temp);
|
||||||
|
|
||||||
/* ... fall through ... */
|
/* ... fall through ... */
|
||||||
|
@ -5930,8 +5930,9 @@ gnat_to_gnu (Node_Id gnat_node)
|
|||||||
|| kind == N_Type_Conversion)
|
|| kind == N_Type_Conversion)
|
||||||
&& Is_Integer_Type (Etype (gnat_node)))
|
&& Is_Integer_Type (Etype (gnat_node)))
|
||||||
&& !(kind == N_Attribute_Reference
|
&& !(kind == N_Attribute_Reference
|
||||||
&& Get_Attribute_Id (Attribute_Name (gnat_node)) == Attr_Length
|
&& (Get_Attribute_Id (Attribute_Name (gnat_node)) == Attr_Length
|
||||||
&& Ekind (Etype (Prefix (gnat_node))) == E_Array_Subtype
|
|| Get_Attribute_Id (Attribute_Name (gnat_node)) == Attr_Size)
|
||||||
|
&& Is_Constrained (Etype (Prefix (gnat_node)))
|
||||||
&& !Is_Constr_Subt_For_U_Nominal (Etype (Prefix (gnat_node))))
|
&& !Is_Constr_Subt_For_U_Nominal (Etype (Prefix (gnat_node))))
|
||||||
&& kind != N_Expanded_Name
|
&& kind != N_Expanded_Name
|
||||||
&& kind != N_Identifier
|
&& kind != N_Identifier
|
||||||
|
Loading…
Reference in New Issue
Block a user