RE: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-31 Thread Zamyatin, Igor
Those macros use =b etc. in asm constraints, so IMHO you'll get the same error as for say: int foo (void) { bar (); int i = 0; asm volatile ( : +b (i)); bar (); return i; } when compiled by gcc 4.9 and earlier with -O2 -m32 -fpic: error: inconsistent operand

RE: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-30 Thread Zamyatin, Igor
Pinski Cc: Uros Bizjak; Vladimir Makarov; GCC Patches Subject: Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code On 10/24/14 17:37, Evgeny Stupachenko wrote: What if we remove the check? glibc build pass? That would be my inclination... But it's not my decision to make

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-30 Thread Jakub Jelinek
On Thu, Oct 30, 2014 at 08:48:57AM +, Zamyatin, Igor wrote: Posted a patch in libc-alpha: https://sourceware.org/ml/libc-alpha/2014-10/msg00701.html That looks wrong. The non-PIC patterns that are enabled unconditionally with the patch set/use ebx, which will not work with pre-GCC 5 in

RE: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-30 Thread Zamyatin, Igor
On Thu, Oct 30, 2014 at 08:48:57AM +, Zamyatin, Igor wrote: Posted a patch in libc-alpha: https://sourceware.org/ml/libc-alpha/2014-10/msg00701.html That looks wrong. The non-PIC patterns that are enabled unconditionally with the patch set/use ebx, which will not work with

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-30 Thread Jakub Jelinek
On Thu, Oct 30, 2014 at 12:34:45PM +, Zamyatin, Igor wrote: On Thu, Oct 30, 2014 at 08:48:57AM +, Zamyatin, Igor wrote: Posted a patch in libc-alpha: https://sourceware.org/ml/libc-alpha/2014-10/msg00701.html That looks wrong. The non-PIC patterns that are enabled

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-29 Thread Evgeny Stupachenko
The test passes now. So let's remove xfail. 2014-10-29 Evgeny Stupachenko evstu...@gmail.com gcc/testsuite * gcc.target/i386/pr23098.c: Remove xfail. diff --git a/gcc/testsuite/gcc.target/i386/pr23098.c b/gcc/testsuite/gcc.target/i386/pr23098.c index 7f118dc..7f118bb 100644 ---

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-29 Thread Uros Bizjak
On Wed, Oct 29, 2014 at 1:28 PM, Evgeny Stupachenko evstu...@gmail.com wrote: The test passes now. So let's remove xfail. 2014-10-29 Evgeny Stupachenko evstu...@gmail.com gcc/testsuite * gcc.target/i386/pr23098.c: Remove xfail. OK. Thanks, Uros.

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-24 Thread Andrew Pinski
On Fri, Oct 10, 2014 at 12:43 AM, Evgeny Stupachenko evstu...@gmail.com wrote: i386 specific part of the patch: 2014-10-08 Ilya Enkovich ilya.enkov...@intel.com Vladimir Makarov vmaka...@redhat.com * gcc/config/i386/i386.c (ix86_use_pseudo_pic_reg): New.

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-24 Thread Evgeny Stupachenko
What if we remove the check? glibc build pass? On Sat, Oct 25, 2014 at 3:09 AM, Andrew Pinski pins...@gmail.com wrote: On Fri, Oct 10, 2014 at 12:43 AM, Evgeny Stupachenko evstu...@gmail.com wrote: i386 specific part of the patch: 2014-10-08 Ilya Enkovich ilya.enkov...@intel.com

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-24 Thread Jeff Law
On 10/24/14 17:37, Evgeny Stupachenko wrote: What if we remove the check? glibc build pass? That would be my inclination... But it's not my decision to make. The first check is to verify glibc builds and passes its testsuite with the new compiler and that check removed. jeff

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-23 Thread Rainer Orth
Evgeny Stupachenko evstu...@gmail.com writes: Reattached. On Mon, Oct 13, 2014 at 8:22 PM, Uros Bizjak ubiz...@gmail.com wrote: On Mon, Oct 13, 2014 at 4:53 PM, Evgeny Stupachenko evstu...@gmail.com wrote: ChangeLog for testsuite: 2014-10-13 Evgeny Stupachenko evstu...@gmail.com

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-14 Thread Jakub Jelinek
On Fri, Oct 10, 2014 at 10:03:38AM -0600, Jeff Law wrote: Can you add a PR markers to your changelog PR target/8340 PR middle-end/47602 PR rtl-optimization/55458 Actually I think there is an additional test in 47602. Can you please add it to the suite? You'll also

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-14 Thread H.J. Lu
On Mon, Oct 13, 2014 at 11:49 AM, H.J. Lu hjl.to...@gmail.com wrote: On Mon, Oct 13, 2014 at 9:32 AM, Evgeny Stupachenko evstu...@gmail.com wrote: Reattached. On Mon, Oct 13, 2014 at 8:22 PM, Uros Bizjak ubiz...@gmail.com wrote: On Mon, Oct 13, 2014 at 4:53 PM, Evgeny Stupachenko

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-14 Thread Jeff Law
On 10/14/14 07:00, Jakub Jelinek wrote: For the first two, I think (and said it before already) that the current model of emitting set_got from a target hook during RA can't work, as there can be calls in the prologue, and the prologue is inserted before the set_got in that case. I really

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-14 Thread H.J. Lu
On Tue, Oct 14, 2014 at 9:43 AM, Jeff Law l...@redhat.com wrote: RA improvements are the way to go -- however, my understanding is that overall the code is better now than it was before Intel's changes, so I don't consider the performance side as a blocker for this code. The new approach

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-13 Thread Evgeny Stupachenko
On Fri, Oct 10, 2014 at 8:03 PM, Jeff Law l...@redhat.com wrote: On 10/10/14 01:42, Evgeny Stupachenko wrote: Hi, The patch enables EBX in RA for x86 32bits PIC mode. It was discussed here: https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02513.html Now there is working version with good

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-13 Thread Evgeny Stupachenko
-#define PIC_OFFSET_TABLE_REGNUM \ - ((TARGET_64BIT (ix86_cmodel == CM_SMALL_PIC \ - || TARGET_PECOFF)) \ - || !flag_pic ? INVALID_REGNUM \ - : reload_completed ? REGNO (pic_offset_table_rtx) \ +#define PIC_OFFSET_TABLE_REGNUM \ + ((TARGET_64BIT (ix86_cmodel ==

Re: [PATCH 3/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-13 Thread Evgeny Stupachenko
Patch updated with the comment: diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 2a64d2d..5fd6a82 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -12455,9 +12455,18 @@ ix86_address_cost (rtx x, enum machine_mode, addr_space_t, bool) || REGNO

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-13 Thread Uros Bizjak
On Mon, Oct 13, 2014 at 5:01 PM, Evgeny Stupachenko evstu...@gmail.com wrote: -#define PIC_OFFSET_TABLE_REGNUM \ - ((TARGET_64BIT (ix86_cmodel == CM_SMALL_PIC \ - || TARGET_PECOFF)) \ - || !flag_pic ? INVALID_REGNUM \ - : reload_completed ? REGNO (pic_offset_table_rtx) \

Re: [PATCH 3/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-13 Thread Uros Bizjak
On Mon, Oct 13, 2014 at 5:17 PM, Evgeny Stupachenko evstu...@gmail.com wrote: Patch updated with the comment: diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 2a64d2d..5fd6a82 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -12455,9 +12455,18 @@

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-13 Thread Uros Bizjak
On Mon, Oct 13, 2014 at 4:53 PM, Evgeny Stupachenko evstu...@gmail.com wrote: ChangeLog for testsuite: 2014-10-13 Evgeny Stupachenko evstu...@gmail.com PR target/8340 PR middle-end/47602 PR rtl-optimization/55458 * gcc.target/i386/pic-1.c: Remove dg-error

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-13 Thread Jeff Law
On 10/13/14 08:53, Evgeny Stupachenko wrote: ChangeLog for testsuite: 2014-10-13 Evgeny Stupachenko evstu...@gmail.com PR target/8340 PR middle-end/47602 PR rtl-optimization/55458 * gcc.target/i386/pic-1.c: Remove dg-error as test should pass now.

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-13 Thread Evgeny Stupachenko
Reattached. On Mon, Oct 13, 2014 at 8:22 PM, Uros Bizjak ubiz...@gmail.com wrote: On Mon, Oct 13, 2014 at 4:53 PM, Evgeny Stupachenko evstu...@gmail.com wrote: ChangeLog for testsuite: 2014-10-13 Evgeny Stupachenko evstu...@gmail.com PR target/8340 PR middle-end/47602

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-13 Thread Uros Bizjak
On Mon, Oct 13, 2014 at 6:32 PM, Evgeny Stupachenko evstu...@gmail.com wrote: Reattached. On Mon, Oct 13, 2014 at 8:22 PM, Uros Bizjak ubiz...@gmail.com wrote: On Mon, Oct 13, 2014 at 4:53 PM, Evgeny Stupachenko evstu...@gmail.com wrote: ChangeLog for testsuite: 2014-10-13 Evgeny

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-13 Thread H.J. Lu
On Mon, Oct 13, 2014 at 9:32 AM, Evgeny Stupachenko evstu...@gmail.com wrote: Reattached. On Mon, Oct 13, 2014 at 8:22 PM, Uros Bizjak ubiz...@gmail.com wrote: On Mon, Oct 13, 2014 at 4:53 PM, Evgeny Stupachenko evstu...@gmail.com wrote: ChangeLog for testsuite: 2014-10-13 Evgeny

[PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-10 Thread Evgeny Stupachenko
Hi, The patch enables EBX in RA for x86 32bits PIC mode. It was discussed here: https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02513.html Now there is working version with good performance and stability level - it could be a solid first step of EBX enabling. Bootstrap and make check passed. There

[PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-10 Thread Evgeny Stupachenko
i386 specific part of the patch: 2014-10-08 Ilya Enkovich ilya.enkov...@intel.com Vladimir Makarov vmaka...@redhat.com * gcc/config/i386/i386.c (ix86_use_pseudo_pic_reg): New. (ix86_init_pic_reg): New. (ix86_select_alt_pic_regnum): Add check on pseudo

[PATCH 3/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-10 Thread Evgeny Stupachenko
the patch improves performance when previous are applied. It makes RTL loop invariant behavior for GOT loads same as it was before the 2 previous patches. It improves 164.gzip (+9%), 253.perlbmk (+2%) giving ~0.5% to SPEC2000int (compiled with “-m32 -Ofast -flto -funroll-loops -fPIC” For example

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-10 Thread Uros Bizjak
On Fri, Oct 10, 2014 at 9:43 AM, Evgeny Stupachenko evstu...@gmail.com wrote: i386 specific part of the patch: 2014-10-08 Ilya Enkovich ilya.enkov...@intel.com Vladimir Makarov vmaka...@redhat.com * gcc/config/i386/i386.c (ix86_use_pseudo_pic_reg): New.

Re: [PATCH 3/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-10 Thread Uros Bizjak
On Fri, Oct 10, 2014 at 9:58 AM, Evgeny Stupachenko evstu...@gmail.com wrote: the patch improves performance when previous are applied. It makes RTL loop invariant behavior for GOT loads same as it was before the 2 previous patches. The patch fixes x86 address cost so that cost for addresses

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-10 Thread Uros Bizjak
On Fri, Oct 10, 2014 at 9:43 AM, Evgeny Stupachenko evstu...@gmail.com wrote: i386 specific part of the patch: 2014-10-08 Ilya Enkovich ilya.enkov...@intel.com Vladimir Makarov vmaka...@redhat.com * gcc/config/i386/i386.c (ix86_use_pseudo_pic_reg): New.

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-10 Thread Rainer Orth
Uros Bizjak ubiz...@gmail.com writes: On Fri, Oct 10, 2014 at 9:43 AM, Evgeny Stupachenko evstu...@gmail.com wrote: i386 specific part of the patch: 2014-10-08 Ilya Enkovich ilya.enkov...@intel.com Vladimir Makarov vmaka...@redhat.com * gcc/config/i386/i386.c

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-10 Thread Jakub Jelinek
On Fri, Oct 10, 2014 at 02:34:07PM +0200, Rainer Orth wrote: Uros Bizjak ubiz...@gmail.com writes: On Fri, Oct 10, 2014 at 9:43 AM, Evgeny Stupachenko evstu...@gmail.com wrote: i386 specific part of the patch: 2014-10-08 Ilya Enkovich ilya.enkov...@intel.com Vladimir

Re: [PATCH 2/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-10 Thread Evgeny Stupachenko
Updated ChangeLog: 2014-10-10 Ilya Enkovich ilya.enkov...@intel.com Vladimir Makarov vmaka...@redhat.com * config/i386/i386.c (ix86_use_pseudo_pic_reg): New. (ix86_init_pic_reg): New. (ix86_select_alt_pic_regnum): Add check on pseudo register.

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-10 Thread Vladimir Makarov
On 2014-10-10 3:42 AM, Evgeny Stupachenko wrote: Hi, The patch enables EBX in RA for x86 32bits PIC mode. It was discussed here: https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02513.html Now there is working version with good performance and stability level - it could be a solid first step of

Re: [PATCH 1/X, i386, PR54232] Enable EBX for x86 in 32bits PIC code

2014-10-10 Thread Jeff Law
On 10/10/14 01:42, Evgeny Stupachenko wrote: Hi, The patch enables EBX in RA for x86 32bits PIC mode. It was discussed here: https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02513.html Now there is working version with good performance and stability level - it could be a solid first step of EBX

Re: Enable EBX for x86 in 32bits PIC code

2014-09-29 Thread Jakub Jelinek
On Wed, Sep 24, 2014 at 03:20:44PM -0600, Jeff Law wrote: On 09/24/14 14:32, Ilya Enkovich wrote: 2014-09-24 19:27 GMT+04:00 Jeff Law l...@redhat.com: On 09/24/14 00:56, Ilya Enkovich wrote: After register allocation we have no idea where GOT address is and therefore delegitimize_address

Re: Enable EBX for x86 in 32bits PIC code

2014-09-24 Thread Ilya Enkovich
2014-09-23 20:10 GMT+04:00 Jeff Law l...@redhat.com: On 09/23/14 10:03, Jakub Jelinek wrote: On Tue, Sep 23, 2014 at 10:00:00AM -0600, Jeff Law wrote: On 09/23/14 08:34, Jakub Jelinek wrote: On Tue, Sep 23, 2014 at 05:54:37PM +0400, Ilya Enkovich wrote: use fixed EBX at least until we

Re: Enable EBX for x86 in 32bits PIC code

2014-09-24 Thread Jeff Law
On 09/24/14 00:56, Ilya Enkovich wrote: 2014-09-23 20:10 GMT+04:00 Jeff Law l...@redhat.com: On 09/23/14 10:03, Jakub Jelinek wrote: On Tue, Sep 23, 2014 at 10:00:00AM -0600, Jeff Law wrote: On 09/23/14 08:34, Jakub Jelinek wrote: On Tue, Sep 23, 2014 at 05:54:37PM +0400, Ilya Enkovich

Re: Enable EBX for x86 in 32bits PIC code

2014-09-24 Thread Ilya Enkovich
2014-09-24 19:27 GMT+04:00 Jeff Law l...@redhat.com: On 09/24/14 00:56, Ilya Enkovich wrote: 2014-09-23 20:10 GMT+04:00 Jeff Law l...@redhat.com: On 09/23/14 10:03, Jakub Jelinek wrote: On Tue, Sep 23, 2014 at 10:00:00AM -0600, Jeff Law wrote: On 09/23/14 08:34, Jakub Jelinek wrote:

Re: Enable EBX for x86 in 32bits PIC code

2014-09-24 Thread Jeff Law
On 09/24/14 14:32, Ilya Enkovich wrote: 2014-09-24 19:27 GMT+04:00 Jeff Law l...@redhat.com: On 09/24/14 00:56, Ilya Enkovich wrote: After register allocation we have no idea where GOT address is and therefore delegitimize_address target hook becomes less efficient and cannot remove

Re: Enable EBX for x86 in 32bits PIC code

2014-09-23 Thread Ilya Enkovich
On 03 Sep 16:19, Vladimir Makarov wrote: On 2014-08-29 2:47 AM, Ilya Enkovich wrote: Seems your patch doesn't cover all cases. Attached is a modified patch (with your changes included) and a test where double constant is wrongly rematerialized. I also see in ira dump that there is still a

Re: Enable EBX for x86 in 32bits PIC code

2014-09-23 Thread Uros Bizjak
On Tue, Sep 23, 2014 at 3:54 PM, Ilya Enkovich enkovich@gmail.com wrote: Here is a patch which combines results of my and Vladimir's work on EBX enabling. It works OK for SPEC2000 and SPEC2006 on -Ofast + LTO. It passes bootstrap but there are few new failures in make check.

Re: Enable EBX for x86 in 32bits PIC code

2014-09-23 Thread Jakub Jelinek
On Tue, Sep 23, 2014 at 05:54:37PM +0400, Ilya Enkovich wrote: use fixed EBX at least until we make sure pseudo PIC doesn't harm debug info generation. If we have such option then gcc.target/i386/pic-1.c and For debug info, it seems you are already handling this in delegitimize_address target

Re: Enable EBX for x86 in 32bits PIC code

2014-09-23 Thread Jeff Law
On 09/23/14 08:23, Uros Bizjak wrote: On Tue, Sep 23, 2014 at 3:54 PM, Ilya Enkovich enkovich@gmail.com wrote: Here is a patch which combines results of my and Vladimir's work on EBX enabling. It works OK for SPEC2000 and SPEC2006 on -Ofast + LTO. It passes bootstrap but there are few

Re: Enable EBX for x86 in 32bits PIC code

2014-09-23 Thread Petr Machata
Jakub Jelinek ja...@redhat.com writes: look at the sizes of .debug_info/.debug_loc sections with/without the patch, or use the locstat utility from elfutils Not actually part of elfutils, but available either here: https://github.com/pmachata/dwlocstat ... or packaged in Fedora.

Re: Enable EBX for x86 in 32bits PIC code

2014-09-23 Thread Jeff Law
On 09/23/14 08:34, Jakub Jelinek wrote: On Tue, Sep 23, 2014 at 05:54:37PM +0400, Ilya Enkovich wrote: use fixed EBX at least until we make sure pseudo PIC doesn't harm debug info generation. If we have such option then gcc.target/i386/pic-1.c and For debug info, it seems you are already

Re: Enable EBX for x86 in 32bits PIC code

2014-09-23 Thread Jakub Jelinek
On Tue, Sep 23, 2014 at 10:00:00AM -0600, Jeff Law wrote: On 09/23/14 08:34, Jakub Jelinek wrote: On Tue, Sep 23, 2014 at 05:54:37PM +0400, Ilya Enkovich wrote: use fixed EBX at least until we make sure pseudo PIC doesn't harm debug info generation. If we have such option then

Re: Enable EBX for x86 in 32bits PIC code

2014-09-23 Thread Jeff Law
On 09/23/14 10:03, Jakub Jelinek wrote: On Tue, Sep 23, 2014 at 10:00:00AM -0600, Jeff Law wrote: On 09/23/14 08:34, Jakub Jelinek wrote: On Tue, Sep 23, 2014 at 05:54:37PM +0400, Ilya Enkovich wrote: use fixed EBX at least until we make sure pseudo PIC doesn't harm debug info generation. If

Re: Enable EBX for x86 in 32bits PIC code

2014-09-11 Thread Jeff Law
On 09/09/14 10:43, Vladimir Makarov wrote: I've investigated the wrong code generation. I did a mistake in my last patch excluding pic pseudo from live-range analysis when risky transformations are on. Here is the right version of all IRA/LRA changes relative to trunk. I managed to compile

Re: Enable EBX for x86 in 32bits PIC code

2014-09-09 Thread Vladimir Makarov
; Richard Biener; Uros Bizjak; Jeff Law Subject: Re: Enable EBX for x86 in 32bits PIC code On 2014-08-29 2:47 AM, Ilya Enkovich wrote: Seems your patch doesn't cover all cases. Attached is a modified patch (with your changes included) and a test where double constant is wrongly rematerialized

Re: Enable EBX for x86 in 32bits PIC code

2014-09-03 Thread Vladimir Makarov
On 2014-08-29 2:47 AM, Ilya Enkovich wrote: Seems your patch doesn't cover all cases. Attached is a modified patch (with your changes included) and a test where double constant is wrongly rematerialized. I also see in ira dump that there is still a copy of PIC reg created: Initialization of

Re: Enable EBX for x86 in 32bits PIC code

2014-09-02 Thread Vladimir Makarov
On 08/29/2014 02:47 AM, Ilya Enkovich wrote: Seems your patch doesn't cover all cases. Attached is a modified patch (with your changes included) and a test where double constant is wrongly rematerialized. I also see in ira dump that there is still a copy of PIC reg created: Initialization

Re: Enable EBX for x86 in 32bits PIC code

2014-08-29 Thread Ilya Enkovich
2014-08-28 12:28 GMT+04:00 Ilya Enkovich enkovich@gmail.com: 2014-08-28 0:19 GMT+04:00 Vladimir Makarov vmaka...@redhat.com: On 2014-08-26 5:42 PM, Ilya Enkovich wrote: Hi, Here is a patch I tried. I apply it over revision 214215. Unfortunately I do not have a small reproducer but the

Re: Enable EBX for x86 in 32bits PIC code

2014-08-29 Thread Ilya Enkovich
2014-08-28 22:58 GMT+04:00 Uros Bizjak ubiz...@gmail.com: On Fri, Aug 22, 2014 at 2:21 PM, Ilya Enkovich enkovich@gmail.com wrote: On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that the best approach would be to not fix ebx

Re: Enable EBX for x86 in 32bits PIC code

2014-08-29 Thread Jeff Law
On 08/28/14 12:58, Uros Bizjak wrote: On Fri, Aug 22, 2014 at 2:21 PM, Ilya Enkovich enkovich@gmail.com wrote: On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that the best approach would be to not fix ebx register, use speudo

Re: Enable EBX for x86 in 32bits PIC code

2014-08-29 Thread Jeff Law
On 08/28/14 07:01, Uros Bizjak wrote: On Fri, Aug 22, 2014 at 2:21 PM, Ilya Enkovich enkovich@gmail.com wrote: Hi, On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that the best approach would be to not fix ebx register, use

Re: Enable EBX for x86 in 32bits PIC code

2014-08-29 Thread Jeff Law
On 08/28/14 02:37, Ilya Enkovich wrote: 2014-08-28 1:39 GMT+04:00 Jeff Law l...@redhat.com: On 08/26/14 15:42, Ilya Enkovich wrote: diff --git a/gcc/calls.c b/gcc/calls.c index 4285ec1..85dae6b 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1122,6 +1122,14 @@ initialize_argument_information

Re: Enable EBX for x86 in 32bits PIC code

2014-08-28 Thread Ilya Enkovich
2014-08-28 0:19 GMT+04:00 Vladimir Makarov vmaka...@redhat.com: On 2014-08-26 5:42 PM, Ilya Enkovich wrote: Hi, Here is a patch I tried. I apply it over revision 214215. Unfortunately I do not have a small reproducer but the problem can be easily reproduced on SPEC2000 benchmark 175.vpr.

Re: Enable EBX for x86 in 32bits PIC code

2014-08-28 Thread Ilya Enkovich
2014-08-28 1:39 GMT+04:00 Jeff Law l...@redhat.com: On 08/26/14 15:42, Ilya Enkovich wrote: diff --git a/gcc/calls.c b/gcc/calls.c index 4285ec1..85dae6b 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1122,6 +1122,14 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,

Re: Enable EBX for x86 in 32bits PIC code

2014-08-28 Thread Uros Bizjak
On Thu, Aug 28, 2014 at 10:37 AM, Ilya Enkovich enkovich@gmail.com wrote: 2014-08-28 1:39 GMT+04:00 Jeff Law l...@redhat.com: On 08/26/14 15:42, Ilya Enkovich wrote: diff --git a/gcc/calls.c b/gcc/calls.c index 4285ec1..85dae6b 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1122,6

Re: Enable EBX for x86 in 32bits PIC code

2014-08-28 Thread Ilya Enkovich
2014-08-28 16:42 GMT+04:00 Uros Bizjak ubiz...@gmail.com: On Thu, Aug 28, 2014 at 10:37 AM, Ilya Enkovich enkovich@gmail.com wrote: 2014-08-28 1:39 GMT+04:00 Jeff Law l...@redhat.com: On 08/26/14 15:42, Ilya Enkovich wrote: diff --git a/gcc/calls.c b/gcc/calls.c index 4285ec1..85dae6b

Re: Enable EBX for x86 in 32bits PIC code

2014-08-28 Thread Uros Bizjak
On Fri, Aug 22, 2014 at 2:21 PM, Ilya Enkovich enkovich@gmail.com wrote: Hi, On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that the best approach would be to not fix ebx register, use speudo register for GOT base address and

Re: Enable EBX for x86 in 32bits PIC code

2014-08-28 Thread Uros Bizjak
On Thu, Aug 28, 2014 at 2:54 PM, Ilya Enkovich enkovich@gmail.com wrote: diff --git a/gcc/calls.c b/gcc/calls.c index 4285ec1..85dae6b 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1122,6 +1122,14 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,

Re: Enable EBX for x86 in 32bits PIC code

2014-08-28 Thread Ilya Enkovich
2014-08-28 17:01 GMT+04:00 Uros Bizjak ubiz...@gmail.com: On Fri, Aug 22, 2014 at 2:21 PM, Ilya Enkovich enkovich@gmail.com wrote: Hi, On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that the best approach would be to not fix

Re: Enable EBX for x86 in 32bits PIC code

2014-08-28 Thread Ilya Enkovich
2014-08-28 17:08 GMT+04:00 Uros Bizjak ubiz...@gmail.com: On Thu, Aug 28, 2014 at 2:54 PM, Ilya Enkovich enkovich@gmail.com wrote: diff --git a/gcc/calls.c b/gcc/calls.c index 4285ec1..85dae6b 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1122,6 +1122,14 @@

Re: Enable EBX for x86 in 32bits PIC code

2014-08-28 Thread Uros Bizjak
On Thu, Aug 28, 2014 at 3:29 PM, Ilya Enkovich enkovich@gmail.com wrote: diff --git a/gcc/calls.c b/gcc/calls.c index 4285ec1..85dae6b 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1122,6 +1122,14 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,

Re: Enable EBX for x86 in 32bits PIC code

2014-08-28 Thread Florian Weimer
On 08/28/2014 03:01 PM, Uros Bizjak wrote: I'd like to avoid X86_TUNE_RELAX_PIC_REG and always treat EBX as an allocatable register. This way, we can avoid all mess with implicit xchgs in atomic_compare_and_swapdwi_doubleword. Also, having allocatable EBX would allow us to introduce

Re: Enable EBX for x86 in 32bits PIC code

2014-08-28 Thread Uros Bizjak
On Fri, Aug 22, 2014 at 2:21 PM, Ilya Enkovich enkovich@gmail.com wrote: On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that the best approach would be to not fix ebx register, use speudo register for GOT base address and let

Re: Enable EBX for x86 in 32bits PIC code

2014-08-27 Thread Vladimir Makarov
On 2014-08-26 5:42 PM, Ilya Enkovich wrote: Hi, Here is a patch I tried. I apply it over revision 214215. Unfortunately I do not have a small reproducer but the problem can be easily reproduced on SPEC2000 benchmark 175.vpr. The problem is in read_arch.c:701 where float value is compared

Re: Enable EBX for x86 in 32bits PIC code

2014-08-27 Thread Jeff Law
On 08/26/14 15:42, Ilya Enkovich wrote: diff --git a/gcc/calls.c b/gcc/calls.c index 4285ec1..85dae6b 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1122,6 +1122,14 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, call_expr_arg_iterator iter; tree arg; +if

Re: Enable EBX for x86 in 32bits PIC code

2014-08-26 Thread Vladimir Makarov
On 08/26/2014 04:57 AM, Ilya Enkovich wrote: 2014-08-26 11:49 GMT+04:00 Ilya Enkovich enkovich@gmail.com: 2014-08-25 19:08 GMT+04:00 Vladimir Makarov vmaka...@redhat.com: On 2014-08-22 8:21 AM, Ilya Enkovich wrote: Hi, On Cauldron 2014 we had a couple of talks about relaxation of ebx

Re: Enable EBX for x86 in 32bits PIC code

2014-08-26 Thread Ilya Enkovich
On 26 Aug 11:25, Vladimir Makarov wrote: On 08/26/2014 04:57 AM, Ilya Enkovich wrote: I've looked into one of fails. There is still a problem with allocation in reload. Here is a piece of code which uses float constant: (insn 1199 1198 1200 96 (set (reg:SI 3 bx) (reg:SI 1301

Re: Enable EBX for x86 in 32bits PIC code

2014-08-26 Thread Ilya Enkovich
2014-08-25 19:08 GMT+04:00 Vladimir Makarov vmaka...@redhat.com: On 2014-08-22 8:21 AM, Ilya Enkovich wrote: Hi, On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that the best approach would be to not fix ebx register, use speudo

Re: Enable EBX for x86 in 32bits PIC code

2014-08-26 Thread Ilya Enkovich
2014-08-26 11:49 GMT+04:00 Ilya Enkovich enkovich@gmail.com: 2014-08-25 19:08 GMT+04:00 Vladimir Makarov vmaka...@redhat.com: On 2014-08-22 8:21 AM, Ilya Enkovich wrote: Hi, On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that

Re: Enable EBX for x86 in 32bits PIC code

2014-08-25 Thread Ilya Enkovich
2014-08-23 5:47 GMT+04:00 Hans-Peter Nilsson h...@bitrange.com: (Dropping gcc@ and people known to subscribe to gcc-patches from the CC.) Sorry for the drive-by review, but... On Fri, 22 Aug 2014, Ilya Enkovich wrote: Hi, On Cauldron 2014 we had a couple of talks about relaxation of ebx

Re: Enable EBX for x86 in 32bits PIC code

2014-08-25 Thread Hans-Peter Nilsson
On Mon, 25 Aug 2014, Ilya Enkovich wrote: 2014-08-23 5:47 GMT+04:00 Hans-Peter Nilsson h...@bitrange.com: ...did you send the right version of the patch? This one uses the RTX-returning hook only in boolean tests, unless I misread. (I did, but not by much.) NULL returned by hook means we

Re: Enable EBX for x86 in 32bits PIC code

2014-08-25 Thread Ilya Enkovich
2014-08-25 15:24 GMT+04:00 Hans-Peter Nilsson h...@bitrange.com: On Mon, 25 Aug 2014, Ilya Enkovich wrote: 2014-08-23 5:47 GMT+04:00 Hans-Peter Nilsson h...@bitrange.com: ...did you send the right version of the patch? This one uses the RTX-returning hook only in boolean tests, unless I

Re: Enable EBX for x86 in 32bits PIC code

2014-08-25 Thread Vladimir Makarov
On 2014-08-22 8:21 AM, Ilya Enkovich wrote: Hi, On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that the best approach would be to not fix ebx register, use speudo register for GOT base address and let allocator do the rest. This

Re: Enable EBX for x86 in 32bits PIC code

2014-08-25 Thread Jeff Law
On 08/22/14 06:21, Ilya Enkovich wrote: Such approach worked well on small tests but trying to run some benchmarks we faced a problem with reload of address constants. The problem is that when we try to rematerialize address constant or some constant memory reference, we have to use

Re: Enable EBX for x86 in 32bits PIC code

2014-08-22 Thread Ilya Enkovich
Hi, On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that the best approach would be to not fix ebx register, use speudo register for GOT base address and let allocator do the rest. This should be similar to how clang and icc work with

Re: Enable EBX for x86 in 32bits PIC code

2014-08-22 Thread Hans-Peter Nilsson
(Dropping gcc@ and people known to subscribe to gcc-patches from the CC.) Sorry for the drive-by review, but... On Fri, 22 Aug 2014, Ilya Enkovich wrote: Hi, On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that the best approach