Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-21 Thread Uecker, Martin
Am Freitag, den 21.12.2018, 16:13 -0500 schrieb Hans-Peter Nilsson: > On Tue, 18 Dec 2018, Uecker, Martin wrote: > > Am Dienstag, den 18.12.2018, 17:29 +0100 schrieb Martin Uecker: > > > Am Dienstag, den 18.12.2018, 17:24 +0100 schrieb Jakub Jelinek: > > > > On Tue, Dec 18, 2018 at 09:03:41AM -0700

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-21 Thread Hans-Peter Nilsson
On Tue, 18 Dec 2018, Uecker, Martin wrote: > Am Dienstag, den 18.12.2018, 17:29 +0100 schrieb Martin Uecker: > > Am Dienstag, den 18.12.2018, 17:24 +0100 schrieb Jakub Jelinek: > > > On Tue, Dec 18, 2018 at 09:03:41AM -0700, Jeff Law wrote: > > > > Right.  This is the classic example and highlights

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-20 Thread Wilco Dijkstra
Hi Martin, > There is a similar mechanism for pointer-to-member-functions > used by C++. Is this correct on aarch64? /* By default, the C++ compiler will use the lowest bit of the pointer    to function to indicate a pointer-to-member-function points to a    virtual member function.  However, if

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-19 Thread Wilco Dijkstra
Hi, Jakub Jelinek wrote: > On Wed, Dec 19, 2018 at 07:53:48PM +, Uecker, Martin wrote: >> What do you think about making the trampoline a single call >> instruction and have a large memory region which is the same >> page mapped many times? This sounds like a good idea, but given a function d

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-19 Thread Jakub Jelinek
On Wed, Dec 19, 2018 at 07:53:48PM +, Uecker, Martin wrote: > What do you think about making the trampoline a single call > instruction and have a large memory region which is the same > page mapped many times? > > > call trampoline_handler > call trampoline_handler > call trampoline_handler

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-19 Thread Uecker, Martin
Am Dienstag, den 18.12.2018, 17:42 +0100 schrieb Jakub Jelinek: > On Tue, Dec 18, 2018 at 04:33:48PM +, Uecker, Martin wrote: > > > Yes, something like this. If the trampolines are pre-allocated, this could > > > even avoid the need to clear the cache on archs where this is needed. > > > > And

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-19 Thread Uecker, Martin
Am Sonntag, den 16.12.2018, 09:13 -0700 schrieb Jeff Law: > It's also important to remember that not every target which uses > function descriptors uses the LSB.  On some targets the LSB may switch > between modes (arm vs thumb for example).  So on those targets the use > of descriptors may imply

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-18 Thread Jakub Jelinek
On Tue, Dec 18, 2018 at 04:33:48PM +, Uecker, Martin wrote: > > Yes, something like this. If the trampolines are pre-allocated, this could > > even avoid the need to clear the cache on archs where this is needed. > > And if we can make the trampolines be all the same (and it somehow derived >

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-18 Thread Uecker, Martin
Am Dienstag, den 18.12.2018, 17:29 +0100 schrieb Martin Uecker: > Am Dienstag, den 18.12.2018, 17:24 +0100 schrieb Jakub Jelinek: > > On Tue, Dec 18, 2018 at 09:03:41AM -0700, Jeff Law wrote: > > > Right.  This is the classic example and highlights the ABI concerns.  If > > > we use the low bit to

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-18 Thread Uecker, Martin
Am Dienstag, den 18.12.2018, 17:24 +0100 schrieb Jakub Jelinek: > On Tue, Dec 18, 2018 at 09:03:41AM -0700, Jeff Law wrote: > > Right.  This is the classic example and highlights the ABI concerns.  If > > we use the low bit to distinguish between a normal function pointer and > > a pointer to a des

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-18 Thread Uecker, Martin
Am Dienstag, den 18.12.2018, 09:03 -0700 schrieb Jeff Law: > On 12/18/18 8:32 AM, Jakub Jelinek wrote: > > On Tue, Dec 18, 2018 at 10:23:46AM -0500, Paul Koning wrote: > > > > > > > > > > On Dec 17, 2018, at 2:23 PM, Szabolcs Nagy > > > > wrote: > > > > > > > > On 17/12/2018 18:22, Uecker, Mar

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-18 Thread Jakub Jelinek
On Tue, Dec 18, 2018 at 09:03:41AM -0700, Jeff Law wrote: > Right. This is the classic example and highlights the ABI concerns. If > we use the low bit to distinguish between a normal function pointer and > a pointer to a descriptor and qsort doesn't know about it, then we lose. > > One way arou

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-18 Thread Jeff Law
On 12/18/18 8:32 AM, Jakub Jelinek wrote: > On Tue, Dec 18, 2018 at 10:23:46AM -0500, Paul Koning wrote: >> >> >>> On Dec 17, 2018, at 2:23 PM, Szabolcs Nagy wrote: >>> >>> On 17/12/2018 18:22, Uecker, Martin wrote: > > ... So a thread_local static variable for storing the static

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-18 Thread Jakub Jelinek
On Tue, Dec 18, 2018 at 10:23:46AM -0500, Paul Koning wrote: > > > > On Dec 17, 2018, at 2:23 PM, Szabolcs Nagy wrote: > > > > On 17/12/2018 18:22, Uecker, Martin wrote: > >>> > >>> ... > >> > >> So a thread_local static variable for storing the static > >> chain? > > > > something like that

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-18 Thread Paul Koning
> On Dec 17, 2018, at 2:23 PM, Szabolcs Nagy wrote: > > On 17/12/2018 18:22, Uecker, Martin wrote: >>> >>> ... >> >> So a thread_local static variable for storing the static >> chain? > > something like that, but the more i think about it the > harder it seems: the call site of the nested f

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-17 Thread Szabolcs Nagy
On 17/12/2018 18:22, Uecker, Martin wrote: > Am Montag, den 17.12.2018, 15:25 + schrieb Szabolcs Nagy: >> On 16/12/2018 22:45, Uecker, Martin wrote: >>> Am Sonntag, den 16.12.2018, 09:13 -0700 schrieb Jeff Law: Ultimately using function descriptors is an ABI breaking choice and we mig

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-17 Thread Andreas Schwab
On Dez 17 2018, "Uecker, Martin" wrote: > Am Montag, den 17.12.2018, 10:28 -0700 schrieb Jeff Law: >> On 12/16/18 3:45 PM, Uecker, Martin wrote: >> > But most architectures require a higher alignment anyway. >> > Here is a list of all targets where function alignment >> > is 1 byte: >> > >> > gc

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-17 Thread Uecker, Martin
Am Montag, den 17.12.2018, 15:25 + schrieb Szabolcs Nagy: > On 16/12/2018 22:45, Uecker, Martin wrote: > > Am Sonntag, den 16.12.2018, 09:13 -0700 schrieb Jeff Law: > > > Ultimately using function descriptors is an ABI breaking choice and we > > > might declare that function descriptors imply h

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-17 Thread Uecker, Martin
Am Montag, den 17.12.2018, 10:31 -0700 schrieb Martin Sebor: > On 12/16/18 6:45 AM, Uecker, Martin wrote: > > Am Freitag, den 14.12.2018, 18:20 -0700 schrieb Martin Sebor: > > > On 12/14/18 4:36 PM, Jeff Law wrote: > > > > On 12/14/18 3:05 AM, Uecker, Martin wrote: > > > > > > > > > > Am Donnersta

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-17 Thread Uecker, Martin
Am Montag, den 17.12.2018, 10:28 -0700 schrieb Jeff Law: > On 12/16/18 3:45 PM, Uecker, Martin wrote: > > Am Sonntag, den 16.12.2018, 09:13 -0700 schrieb Jeff Law: > > > On 12/16/18 6:45 AM, Uecker, Martin wrote: > > > > Am Freitag, den 14.12.2018, 18:20 -0700 schrieb Martin Sebor: > > > > > On 12/

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-17 Thread Martin Sebor
On 12/16/18 6:45 AM, Uecker, Martin wrote: Am Freitag, den 14.12.2018, 18:20 -0700 schrieb Martin Sebor: On 12/14/18 4:36 PM, Jeff Law wrote: On 12/14/18 3:05 AM, Uecker, Martin wrote: Am Donnerstag, den 13.12.2018, 16:35 -0700 schrieb Jeff Law: On 12/12/18 11:12 AM, Uecker, Martin wrote:

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-17 Thread Jeff Law
On 12/16/18 3:45 PM, Uecker, Martin wrote: > Am Sonntag, den 16.12.2018, 09:13 -0700 schrieb Jeff Law: >> On 12/16/18 6:45 AM, Uecker, Martin wrote: >>> Am Freitag, den 14.12.2018, 18:20 -0700 schrieb Martin Sebor: On 12/14/18 4:36 PM, Jeff Law wrote: > On 12/14/18 3:05 AM, Uecker, Martin

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-17 Thread Szabolcs Nagy
On 16/12/2018 22:45, Uecker, Martin wrote: > Am Sonntag, den 16.12.2018, 09:13 -0700 schrieb Jeff Law: >> Ultimately using function descriptors is an ABI breaking choice and we >> might declare that function descriptors imply higher function >> alignments.   > > Increasing the alignment is not an

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-16 Thread Uecker, Martin
Am Sonntag, den 16.12.2018, 09:13 -0700 schrieb Jeff Law: > On 12/16/18 6:45 AM, Uecker, Martin wrote: > > Am Freitag, den 14.12.2018, 18:20 -0700 schrieb Martin Sebor: > > > On 12/14/18 4:36 PM, Jeff Law wrote: > > > > On 12/14/18 3:05 AM, Uecker, Martin wrote: > > > > > > > > > > Am Donnerstag,

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-16 Thread Jeff Law
On 12/16/18 6:45 AM, Uecker, Martin wrote: > Am Freitag, den 14.12.2018, 18:20 -0700 schrieb Martin Sebor: >> On 12/14/18 4:36 PM, Jeff Law wrote: >>> On 12/14/18 3:05 AM, Uecker, Martin wrote: Am Donnerstag, den 13.12.2018, 16:35 -0700 schrieb Jeff Law: > On 12/12/18 11:12 AM, Uecker

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-16 Thread Uecker, Martin
Am Freitag, den 14.12.2018, 18:20 -0700 schrieb Martin Sebor: > On 12/14/18 4:36 PM, Jeff Law wrote: > > On 12/14/18 3:05 AM, Uecker, Martin wrote: > > > > > > Am Donnerstag, den 13.12.2018, 16:35 -0700 schrieb Jeff Law: > > > > On 12/12/18 11:12 AM, Uecker, Martin wrote: > > > > > > ... > > > >

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-14 Thread Martin Sebor
On 12/14/18 4:36 PM, Jeff Law wrote: On 12/14/18 3:05 AM, Uecker, Martin wrote: Am Donnerstag, den 13.12.2018, 16:35 -0700 schrieb Jeff Law: On 12/12/18 11:12 AM, Uecker, Martin wrote: ... diff --git a/gcc/c/c-objc-common.h b/gcc/c/c-objc-common.h index 78e768c2366..ef039560eb9 100644 --- a/

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-14 Thread Jeff Law
On 12/14/18 3:05 AM, Uecker, Martin wrote: > > Am Donnerstag, den 13.12.2018, 16:35 -0700 schrieb Jeff Law: >> On 12/12/18 11:12 AM, Uecker, Martin wrote: > ... > diff --git a/gcc/c/c-objc-common.h b/gcc/c/c-objc-common.h > index 78e768c2366..ef039560eb9 100644 > --- a/gcc/c/c-objc-com

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-14 Thread Uecker, Martin
Am Donnerstag, den 13.12.2018, 16:35 -0700 schrieb Jeff Law: > On 12/12/18 11:12 AM, Uecker, Martin wrote: ... > > > > diff --git a/gcc/c/c-objc-common.h b/gcc/c/c-objc-common.h > > > > index 78e768c2366..ef039560eb9 100644 > > > > --- a/gcc/c/c-objc-common.h > > > > +++ b/gcc/c/c-objc-common.h

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-13 Thread Jeff Law
On 12/12/18 11:12 AM, Uecker, Martin wrote: > > Hi Jeff, > > thank you. I fixed all the minor issues, but see below. > > > Am Montag, den 03.12.2018, 14:56 -0700 schrieb Jeff Law: >> On 11/4/18 1:48 PM, Uecker, Martin wrote: >>> Hi Joseph, >>> >>> here is a new version of this patch which adds

[PATCH v4][C][ADA] use function descriptors instead of trampolines in C

2018-12-12 Thread Uecker, Martin
Hi Jeff, thank you. I fixed all the minor issues, but see below. Am Montag, den 03.12.2018, 14:56 -0700 schrieb Jeff Law: > On 11/4/18 1:48 PM, Uecker, Martin wrote: > > Hi Joseph, > > > > here is a new version of this patch which adds a warning > > for targets which do not support -fno-trampo