From: Tristan Gingold <gingold@adacore.com>
To: Duncan Sands <baldrick@free.fr>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [Ada] Ease interface with builtins that returns void *
Date: Mon, 16 Jul 2012 13:18:00 -0000 [thread overview]
Message-ID: <ED660632-DCD7-4AE4-87E5-E56532735C93@adacore.com> (raw)
In-Reply-To: <50041411.1050302@free.fr>
On Jul 16, 2012, at 3:16 PM, Duncan Sands wrote:
> Hi Arnaud,
>
>> The natural way to import a builtin that returns void * is to use
>> System.Address in Ada, which is in fact an integral type.
>
> how about doing this for formal arguments too and not just the return type?
Formal arguments were already handled.
Tristan.
> This would improve optimization by LLVM of calls to standard library functions
> since the optimizers bail out when they see an "int" parameter where normally
> there would be a void* (or other pointer type).
>
> Ciao, Duncan.
>
>>
>> Addressed by this patch, which makes it possible to e.g. compile:
>>
>> with System;
>> procedure Btins1 is
>>
>> function Frame_Address (Level : Integer) return System.Address;
>> pragma Import (Intrinsic, Frame_Address, "__builtin_frame_address");
>>
>> Ptr : System.Address;
>> pragma Volatile (Ptr);
>> begin
>> Ptr := Frame_Address (0);
>> end;
>>
>> Tested on x86_64-pc-linux-gnu, committed on trunk
>>
>> 2012-07-16 Tristan Gingold <gingold@adacore.com>
>>
>> * gcc-interface/decl.c (intrin_return_compatible_p): Map Address to
>> void *.
>>
>
>
next prev parent reply other threads:[~2012-07-16 13:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-16 13:11 Arnaud Charlet
2012-07-16 13:16 ` Duncan Sands
2012-07-16 13:18 ` Tristan Gingold [this message]
2012-07-16 13:24 ` Duncan Sands
2012-07-16 13:52 ` Tristan Gingold
2012-07-16 13:58 ` Duncan Sands
2012-07-16 14:31 ` Tristan Gingold
2012-07-16 14:36 ` Duncan Sands
2012-07-16 14:42 ` Tristan Gingold
2012-07-16 14:52 ` Duncan Sands
2012-07-16 15:17 ` Duncan Sands
2012-07-16 15:26 ` Tristan Gingold
2012-07-16 16:22 ` Eric Botcazou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ED660632-DCD7-4AE4-87E5-E56532735C93@adacore.com \
--to=gingold@adacore.com \
--cc=baldrick@free.fr \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).