Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-06-23 Thread Jeff Law
On 06/23/2015 02:29 AM, Ramana Radhakrishnan wrote: If you try disabling the REG_EQUAL note generation [*], you'll probably find a performance regression on arm32 (and probably on aarch64 as well? we only IMHO disabling the REG_EQUAL note generation is the wrong way to go about this. Agreed.

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-06-23 Thread Alexander Monakov
On Tue, 23 Jun 2015, Ramana Radhakrishnan wrote: > > If you try disabling the REG_EQUAL note generation [*], you'll probably > > find a > > performance regression on arm32 (and probably on aarch64 as well? > > we only > > IMHO disabling the REG_EQUAL note generation is the wrong way to go about

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-06-23 Thread Ramana Radhakrishnan
On Mon, Jun 22, 2015 at 7:11 PM, Alexander Monakov wrote: > On Mon, 22 Jun 2015, Jiong Wang wrote: >> Have done a quick experiment, -fno-plt doesn't work on AArch64. >> >> it's because although this patch force the function address into register, >> but the combine pass runs later combine it back

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-06-22 Thread Alexander Monakov
On Mon, 22 Jun 2015, Jiong Wang wrote: > Have done a quick experiment, -fno-plt doesn't work on AArch64. > > it's because although this patch force the function address into register, > but the combine pass runs later combine it back as AArch64 have defined such > insn pattern. > > For X86, it's

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-06-22 Thread Jiong Wang
On 04/05/15 17:37, Alexander Monakov wrote: This patch introduces option -fno-plt that allows to expand calls that would go via PLT to load the address of the function immediately at call site (which introduces a GOT load). Cover letter explains the motivation for this patch. New option docume

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-11 Thread Jan Hubicka
> >> This won't play well with LTO since fplt will become another global flag > >> while > >> it affects codegen. > > > > I know Richi explained this to me in the past, but I can't remember the > > details of why this is bad. Can you walk me through it again? > > > > I have proposed a different a

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-11 Thread H.J. Lu
On Mon, May 11, 2015 at 1:36 PM, Jeff Law wrote: > On 05/10/2015 10:59 AM, Jan Hubicka wrote: >>> >>> This patch introduces option -fno-plt that allows to expand calls that >>> would >>> go via PLT to load the address of the function immediately at call site >>> (which >>> introduces a GOT load).

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-11 Thread Jeff Law
On 05/10/2015 10:59 AM, Jan Hubicka wrote: This patch introduces option -fno-plt that allows to expand calls that would go via PLT to load the address of the function immediately at call site (which introduces a GOT load). Cover letter explains the motivation for this patch. New option document

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-11 Thread Rich Felker
On Mon, May 11, 2015 at 01:48:03PM +0200, Michael Matz wrote: > Hi, > > On Wed, 6 May 2015, Rich Felker wrote: > > > I don't see how this case is improved unless GCC is failing to consider > > strong definitions in the same TU as locally-binding. > > Interposition of non-static non-inline non-w

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-11 Thread Michael Matz
Hi, On Wed, 6 May 2015, Rich Felker wrote: > I don't see how this case is improved unless GCC is failing to consider > strong definitions in the same TU as locally-binding. Interposition of non-static non-inline non-weak symbols is supported independend of if they are defined in the same TU or

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-10 Thread Jan Hubicka
> On Mon, May 04, 2015 at 11:42:20AM -0600, Jeff Law wrote: > > On 05/04/2015 11:39 AM, Jakub Jelinek wrote: > > >On Mon, May 04, 2015 at 11:34:05AM -0600, Jeff Law wrote: > > >>On 05/04/2015 10:37 AM, Alexander Monakov wrote: > > >>>This patch introduces option -fno-plt that allows to expand calls

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-10 Thread Jan Hubicka
> This patch introduces option -fno-plt that allows to expand calls that would > go via PLT to load the address of the function immediately at call site (which > introduces a GOT load). Cover letter explains the motivation for this patch. > > New option documentation for invoke.texi is missing fr

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-07 Thread H.J. Lu
On Thu, May 7, 2015 at 11:22 AM, Jeff Law wrote: > On 05/06/2015 09:24 AM, Alexander Monakov wrote: >> >> On Mon, 4 May 2015, Jeff Law wrote: >>> >>> On 05/04/2015 11:39 AM, Jakub Jelinek wrote: On Mon, May 04, 2015 at 11:34:05AM -0600, Jeff Law wrote: > > On 05/04/2015 10:37 AM,

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-07 Thread Jeff Law
On 05/06/2015 09:24 AM, Alexander Monakov wrote: On Mon, 4 May 2015, Jeff Law wrote: On 05/04/2015 11:39 AM, Jakub Jelinek wrote: On Mon, May 04, 2015 at 11:34:05AM -0600, Jeff Law wrote: On 05/04/2015 10:37 AM, Alexander Monakov wrote: This patch introduces option -fno-plt that allows to exp

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread H.J. Lu
On Wed, May 6, 2015 at 12:17 PM, Rich Felker wrote: > On Wed, May 06, 2015 at 12:05:20PM -0700, H.J. Lu wrote: >> >> -Bsymbolic will bind all references to local definitions in shared >> >> libraries, >> >> with and without visibility, weak or non-weak. Compiler can use it >> >> in binds_tls_loc

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread Rich Felker
On Wed, May 06, 2015 at 12:05:20PM -0700, H.J. Lu wrote: > >> -Bsymbolic will bind all references to local definitions in shared > >> libraries, > >> with and without visibility, weak or non-weak. Compiler can use it > >> in binds_tls_local_p and we can generate much better codes in shared > >> l

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread H.J. Lu
On Wed, May 6, 2015 at 12:01 PM, Rich Felker wrote: > On Wed, May 06, 2015 at 11:44:57AM -0700, H.J. Lu wrote: >> On Wed, May 6, 2015 at 11:37 AM, Rich Felker wrote: >> > On Wed, May 06, 2015 at 11:26:29AM -0700, H.J. Lu wrote: >> >> On Wed, May 6, 2015 at 10:35 AM, Rich Felker wrote: >> >> > On

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread Rich Felker
On Wed, May 06, 2015 at 11:44:57AM -0700, H.J. Lu wrote: > On Wed, May 6, 2015 at 11:37 AM, Rich Felker wrote: > > On Wed, May 06, 2015 at 11:26:29AM -0700, H.J. Lu wrote: > >> On Wed, May 6, 2015 at 10:35 AM, Rich Felker wrote: > >> > On Wed, May 06, 2015 at 07:43:58PM +0300, Alexander Monakov w

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread H.J. Lu
On Wed, May 6, 2015 at 11:37 AM, Rich Felker wrote: > On Wed, May 06, 2015 at 11:26:29AM -0700, H.J. Lu wrote: >> On Wed, May 6, 2015 at 10:35 AM, Rich Felker wrote: >> > On Wed, May 06, 2015 at 07:43:58PM +0300, Alexander Monakov wrote: >> >> On Wed, 6 May 2015, Jakub Jelinek wrote: >> >> > The

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread Rich Felker
On Wed, May 06, 2015 at 11:26:29AM -0700, H.J. Lu wrote: > On Wed, May 6, 2015 at 10:35 AM, Rich Felker wrote: > > On Wed, May 06, 2015 at 07:43:58PM +0300, Alexander Monakov wrote: > >> On Wed, 6 May 2015, Jakub Jelinek wrote: > >> > The linker would know very well what kind of relocations are us

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread H.J. Lu
On Wed, May 6, 2015 at 10:35 AM, Rich Felker wrote: > On Wed, May 06, 2015 at 07:43:58PM +0300, Alexander Monakov wrote: >> On Wed, 6 May 2015, Jakub Jelinek wrote: >> > The linker would know very well what kind of relocations are used for >> > particular PLT slot, and for the new relocations whic

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread Rich Felker
On Wed, May 06, 2015 at 07:43:58PM +0300, Alexander Monakov wrote: > On Wed, 6 May 2015, Jakub Jelinek wrote: > > The linker would know very well what kind of relocations are used for > > particular PLT slot, and for the new relocations which would resolve to the > > address of the .got.plt slot it

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread Alexander Monakov
On Wed, 6 May 2015, Jakub Jelinek wrote: > The linker would know very well what kind of relocations are used for > particular PLT slot, and for the new relocations which would resolve to the > address of the .got.plt slot it could just tweak corresponding 3rd insn > in the slot, to not jump to firs

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread Jeff Law
On 05/06/2015 09:45 AM, Jakub Jelinek wrote: As for hoisting the load of the call address before the loop, with lazy binding that has the obvious disadvantage that you'd resolve the slot again and again, if you are unlucky enough that the function hasn't been resolved yet. Unless the shared PLT

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread Jakub Jelinek
On Wed, May 06, 2015 at 06:24:58PM +0300, Alexander Monakov wrote: > If the same PLT stubs as today are to be used, it constrains the compiler on > 32-bit x86 and possibly other arches where PLT stubs need GOT pointer in a > specific register. It's possible to imagine more complex PLT stubs that >

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-06 Thread Alexander Monakov
On Mon, 4 May 2015, Jeff Law wrote: > On 05/04/2015 11:39 AM, Jakub Jelinek wrote: > > On Mon, May 04, 2015 at 11:34:05AM -0600, Jeff Law wrote: > > > On 05/04/2015 10:37 AM, Alexander Monakov wrote: > > > > This patch introduces option -fno-plt that allows to expand calls that > > > > would > > >

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-05 Thread Rich Felker
On Mon, May 04, 2015 at 11:42:20AM -0600, Jeff Law wrote: > On 05/04/2015 11:39 AM, Jakub Jelinek wrote: > >On Mon, May 04, 2015 at 11:34:05AM -0600, Jeff Law wrote: > >>On 05/04/2015 10:37 AM, Alexander Monakov wrote: > >>>This patch introduces option -fno-plt that allows to expand calls that > >

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-04 Thread Jeff Law
On 05/04/2015 11:39 AM, Jakub Jelinek wrote: On Mon, May 04, 2015 at 11:34:05AM -0600, Jeff Law wrote: On 05/04/2015 10:37 AM, Alexander Monakov wrote: This patch introduces option -fno-plt that allows to expand calls that would go via PLT to load the address of the function immediately at call

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-04 Thread Jakub Jelinek
On Mon, May 04, 2015 at 11:34:05AM -0600, Jeff Law wrote: > On 05/04/2015 10:37 AM, Alexander Monakov wrote: > >This patch introduces option -fno-plt that allows to expand calls that would > >go via PLT to load the address of the function immediately at call site > >(which > >introduces a GOT load

Re: [PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-04 Thread Jeff Law
On 05/04/2015 10:37 AM, Alexander Monakov wrote: This patch introduces option -fno-plt that allows to expand calls that would go via PLT to load the address of the function immediately at call site (which introduces a GOT load). Cover letter explains the motivation for this patch. New option do

[PATCH] Expand PIC calls without PLT with -fno-plt

2015-05-04 Thread Alexander Monakov
This patch introduces option -fno-plt that allows to expand calls that would go via PLT to load the address of the function immediately at call site (which introduces a GOT load). Cover letter explains the motivation for this patch. New option documentation for invoke.texi is missing from the pat