(gnat_to_gnu_param): Use void_ptr GCC type for System.Address argument
authorOlivier Hainque <hainque@adacore.com>
Wed, 23 Jun 2010 08:56:20 +0000 (08:56 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 23 Jun 2010 08:56:20 +0000 (10:56 +0200)
of GCC builtin imports.

From-SVN: r161261

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c

index 96cd48539a91ca3f84bf5599f0230b7b8c1d5926..fff58560a0208dd7abb4be0e7b03f66737cc70a2 100644 (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>
 
index c263548e24238b588637e05a8efd6b895a08006e..c2f697e94454977a5f79b64a6efd6f2366683f43 100644 (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))