(gnat_to_gnu_param): Use void_ptr GCC type for System.Address argument

of GCC builtin imports.

From-SVN: r161261
This commit is contained in:
Olivier Hainque 2010-06-23 08:56:20 +00:00 committed by Arnaud Charlet
parent d92eccc359
commit 2503cb81ee
2 changed files with 8 additions and 0 deletions

View File

@ -48,6 +48,8 @@
(intrin_return_compatible_p): Never warn on "function imported as
procedure". Defer the void/void case to the common type compatibility
check.
(gnat_to_gnu_param): Use void_ptr GCC type for System.Address argument
of GCC builtin imports.
2010-06-23 Olivier Hainque <hainque@adacore.com>

View File

@ -5264,6 +5264,12 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
gnu_param_type
= TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_param_type))));
/* For GCC builtins, pass Address integer types as (void *) */
if (Convention (gnat_subprog) == Convention_Intrinsic
&& Present (Interface_Name (gnat_subprog))
&& Is_Descendent_Of_Address (Etype (gnat_param)))
gnu_param_type = ptr_void_type_node;
/* VMS descriptors are themselves passed by reference. */
if (mech == By_Short_Descriptor ||
(mech == By_Descriptor && TARGET_ABI_OPEN_VMS && !TARGET_MALLOC64))