Re: [PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-29 Thread Evgeny Stupachenko
Patch with the fixes: Bootstrap, gcc make check and spec2000 with -p passed. 2014-10-29 Evgeny Stupachenko evstu...@gmail.com gcc/testsuite PR target/63534 * gcc.target/i386/mcount_pic.c: New. gcc/ PR target/63534 * config/i386/i386.c (ix86_init_pic_reg): Emit

Re: [PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-29 Thread Jakub Jelinek
On Wed, Oct 29, 2014 at 12:21:15PM +0300, Evgeny Stupachenko wrote: Patch with the fixes: Bootstrap, gcc make check and spec2000 with -p passed. 2014-10-29 Evgeny Stupachenko evstu...@gmail.com gcc/testsuite PR target/63534 * gcc.target/i386/mcount_pic.c: New. gcc/

Re: [PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-28 Thread Evgeny Stupachenko
Thank you, Jakub. The following patch passed bootstrap, gcc make check and spec2000 with -p -m32 -fPIC. Is it ok? ChangeLog: 2014-10-28 Evgeny Stupachenko evstu...@gmail.com gcc/testsuite * gcc.target/i386/mcount_pic.c: New. gcc/ * config/i386/i386.c (ix86_init_pic_reg):

Re: [PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-28 Thread Jakub Jelinek
On Tue, Oct 28, 2014 at 04:10:12PM +0300, Evgeny Stupachenko wrote: Thank you, Jakub. The following patch passed bootstrap, gcc make check and spec2000 with -p -m32 -fPIC. Is it ok? ChangeLog: 2014-10-28 Evgeny Stupachenko evstu...@gmail.com gcc/testsuite *

Re: [PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-28 Thread Evgeny Stupachenko
Agree. Let't stop at first insn after entry block notes. As for the test it looks like mcount is general i?86 name. Bootstrap and make check are in progress. 2014-10-28 Evgeny Stupachenko evstu...@gmail.com gcc/testsuite PR target/63534 * gcc.target/i386/mcount_pic.c: New.

Re: [PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-28 Thread Jakub Jelinek
On Tue, Oct 28, 2014 at 06:28:29PM +0300, Evgeny Stupachenko wrote: +/* Delete SET_GOT right after entry block if it is allocated to reg. */ + +static void +ix86_elim_entry_set_got (rtx reg) +{ + basic_block bb = ENTRY_BLOCK_PTR_FOR_FN (cfun)-next_bb; + rtx_insn *c_insn; +

Re: [PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-24 Thread Evgeny Stupachenko
The following patch align stack for mcount and there should be no problems with unwind as ix86_frame_pointer_required is true when crtl-profile is true and flag_fentry is false (we call mcount after function prolog). When flag_fentry is true it is set to false in 32bit PIC mode: if

Re: [PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-24 Thread Jakub Jelinek
On Fri, Oct 24, 2014 at 06:12:15PM +0400, Evgeny Stupachenko wrote: The following patch align stack for mcount and there should be no problems with unwind as ix86_frame_pointer_required is true when crtl-profile is true and flag_fentry is false (we call mcount after function prolog). When

Re: [PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-24 Thread Evgeny Stupachenko
What is wrong in emitting the set_got right before the PROLOGUE_END note and that way sharing a single load from both? Can you please explain the idea? Now set_got emitted right after PROLOGUE_END, what is the advantage in emitting it right before? Which load is going to be shared? This looks

Re: [PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-24 Thread Jakub Jelinek
On Fri, Oct 24, 2014 at 07:19:53PM +0400, Evgeny Stupachenko wrote: What is wrong in emitting the set_got right before the PROLOGUE_END note and that way sharing a single load from both? Can you please explain the idea? Now set_got emitted right after PROLOGUE_END, what is the advantage in

[PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-17 Thread Evgeny Stupachenko
Hi, The patch fixes profile in 32bits PIC mode (only -p option affected). x86 bootstrap, make check passed spec2000 o2 -p train data on Corei7: CINT -5% CFP +1,5 compared to a compiler before enabling ebx. There is a potential performance improve after the patch applied suggested by Jakub:

Re: [PATCH, x86, 63534] Fix '-p' profile for 32 bit PIC mode

2014-10-17 Thread Jakub Jelinek
On Fri, Oct 17, 2014 at 06:30:42PM +0400, Evgeny Stupachenko wrote: Hi, The patch fixes profile in 32bits PIC mode (only -p option affected). x86 bootstrap, make check passed spec2000 o2 -p train data on Corei7: CINT -5% CFP +1,5 compared to a compiler before enabling ebx. There