public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/63527] New: [5 Regression] -fPIC generates more instructions
@ 2014-10-13 18:49 hjl.tools at gmail dot com
  2014-10-14  0:04 ` [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT hjl.tools at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-10-13 18:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63527

            Bug ID: 63527
           Summary: [5 Regression] -fPIC generates more instructions
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: evstupac at gmail dot com
            Target: i686-linux

On Linux/x86, r216154 generates more instructions with -O2 -fPIC
for

----
struct cache_file
{
  char magic[sizeof "ld.so-1.7.0" - 1];
  unsigned int nlibs;
};
typedef unsigned int size_t;
size_t cachesize __attribute__ ((visibility ("hidden")));
struct cache_file *cache __attribute__ ((visibility ("hidden")));
extern int __munmap (void *__addr, size_t __len);
void
_dl_unload_cache (void)
{
  if (cache != ((void *)0) && cache != (struct cache_file *) -1)
    {
      __munmap (cache, cachesize);
      cache = ((void *)0) ;
    }
}
----

r216153 generates

---
    .text
.LHOTB0:
    .p2align 4,,15
    .globl    _dl_unload_cache
    .type    _dl_unload_cache, @function
_dl_unload_cache:
    pushl    %ebx
    call    __x86.get_pc_thunk.bx
    addl    $_GLOBAL_OFFSET_TABLE_, %ebx
    subl    $8, %esp
    movl    cache@GOTOFF(%ebx), %eax
    leal    -1(%eax), %edx
    cmpl    $-3, %edx
    ja    .L1
    subl    $8, %esp
    pushl    cachesize@GOTOFF(%ebx)
    pushl    %eax
    call    __munmap@PLT
    movl    $0, cache@GOTOFF(%ebx)
    addl    $16, %esp
.L1:
    addl    $8, %esp
    popl    %ebx
    ret
    .size    _dl_unload_cache, .-_dl_unload_cache
    .section    .text.unlikely
.LCOLDE0:
    .text
.LHOTE0:
    .hidden    cache
    .comm    cache,4,4
    .hidden    cachesize
    .comm    cachesize,4,4
    .section   
.text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
    .globl    __x86.get_pc_thunk.bx
    .hidden    __x86.get_pc_thunk.bx
    .type    __x86.get_pc_thunk.bx, @function
__x86.get_pc_thunk.bx:
    movl    (%esp), %ebx
    ret
---

r216154 generates

--
    .text
.LHOTB0:
    .p2align 4,,15
    .globl    _dl_unload_cache
    .type    _dl_unload_cache, @function
_dl_unload_cache:
    pushl    %esi
    pushl    %ebx
    call    __x86.get_pc_thunk.si
    addl    $_GLOBAL_OFFSET_TABLE_, %esi
    subl    $4, %esp
    movl    cache@GOTOFF(%esi), %eax
    leal    -1(%eax), %edx
    cmpl    $-3, %edx
    ja    .L1
    subl    $8, %esp
    pushl    cachesize@GOTOFF(%esi)
    movl    %esi, %ebx
    pushl    %eax
    call    __munmap@PLT
    movl    $0, cache@GOTOFF(%esi)
    addl    $16, %esp
.L1:
    addl    $4, %esp
    popl    %ebx
    popl    %esi
    ret
    .size    _dl_unload_cache, .-_dl_unload_cache
    .section    .text.unlikely
.LCOLDE0:
    .text
.LHOTE0:
    .hidden    cache
    .comm    cache,4,4
    .hidden    cachesize
    .comm    cachesize,4,4
    .section   
.text.__x86.get_pc_thunk.si,"axG",@progbits,__x86.get_pc_thunk.si,comdat
    .globl    __x86.get_pc_thunk.si
    .hidden    __x86.get_pc_thunk.si
    .type    __x86.get_pc_thunk.si, @function
__x86.get_pc_thunk.si:
    movl    (%esp), %esi
    ret
--

Why doesn't r216154 simply use %ebx to access cache, cachesize
and __munmap?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT
  2014-10-13 18:49 [Bug target/63527] New: [5 Regression] -fPIC generates more instructions hjl.tools at gmail dot com
@ 2014-10-14  0:04 ` hjl.tools at gmail dot com
  2014-10-14  7:51 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-10-14  0:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63527

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-10-14
            Summary|[5 Regression] -fPIC        |[5 Regression] -fPIC uses 2
                   |generates more instructions |registers for GOT
     Ever confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
GCC uses 2 registers for GOT access, instead of one.  One register
is allocated by LRA and EBX is used by ix86_expand_call.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT
  2014-10-13 18:49 [Bug target/63527] New: [5 Regression] -fPIC generates more instructions hjl.tools at gmail dot com
  2014-10-14  0:04 ` [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT hjl.tools at gmail dot com
@ 2014-10-14  7:51 ` rguenth at gcc dot gnu.org
  2014-11-10 22:17 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-10-14  7:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63527

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
   Target Milestone|---                         |5.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT
  2014-10-13 18:49 [Bug target/63527] New: [5 Regression] -fPIC generates more instructions hjl.tools at gmail dot com
  2014-10-14  0:04 ` [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT hjl.tools at gmail dot com
  2014-10-14  7:51 ` rguenth at gcc dot gnu.org
@ 2014-11-10 22:17 ` ubizjak at gmail dot com
  2014-11-15  8:29 ` ubizjak at gmail dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2014-11-10 22:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63527

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ra
                 CC|                            |vmakarov at gcc dot gnu.org

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
RA issue with PIC register, adding CC.
>From gcc-bugs-return-466301-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Nov 10 23:30:40 2014
Return-Path: <gcc-bugs-return-466301-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1149 invoked by alias); 10 Nov 2014 23:30:40 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 1066 invoked by uid 55); 10 Nov 2014 23:30:35 -0000
From: "uros at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/63620] RELOAD lost SET_GOT dependency on Darwin
Date: Mon, 10 Nov 2014 23:30:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: ra
X-Bugzilla-Severity: normal
X-Bugzilla-Who: uros at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: vmakarov at redhat dot com
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-63620-4-5NlejoLW7l@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63620-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63620-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-11/txt/msg00773.txt.bz2
Content-length: 1055

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc620

--- Comment #30 from uros at gcc dot gnu.org ---
Author: uros
Date: Mon Nov 10 23:29:59 2014
New Revision: 217325

URL: https://gcc.gnu.org/viewcvs?rev!7325&root=gcc&view=rev
Log:
2014-11-11  Uros Bizjak  <ubizjak@gmail.com>

    Revert:
    2014-10-31  Uros Bizjak  <ubizjak@gmail.com>

    PR target/63620
    * config/i386/i386-protos.h (ix86_use_pseudo_pic_reg): Declare.
    * config/i386/i386.c (ix86_use_pseudo_pic_reg): Export.
    * config/i386/i386.md (*pushtf): Allow only CONST_DOUBLEs that won't
    be reloaded through memory.
    (*pushxf): Ditto.
    (*pushdf): Ditto.

testsuite/ChangeLog:

2014-11-11  Uros Bizjak  <ubizjak@gmail.com>
        Ilya Enkovich  <ilya.enkovich@intel.com>

    PR target/63620
    * gcc.target/i386/pr63620.c: New test.


Added:
    trunk/gcc/testsuite/gcc.target/i386/pr63620.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386-protos.h
    trunk/gcc/config/i386/i386.c
    trunk/gcc/config/i386/i386.md
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT
  2014-10-13 18:49 [Bug target/63527] New: [5 Regression] -fPIC generates more instructions hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2014-11-10 22:17 ` ubizjak at gmail dot com
@ 2014-11-15  8:29 ` ubizjak at gmail dot com
  2014-11-20 12:24 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2014-11-15  8:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63527

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ubizjak at gmail dot com

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
Still happens with r217599.
>From gcc-bugs-return-466839-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Nov 15 08:39:25 2014
Return-Path: <gcc-bugs-return-466839-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10315 invoked by alias); 15 Nov 2014 08:39:25 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 10279 invoked by uid 48); 15 Nov 2014 08:39:21 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/63884] ICE: SIGSEGV in is_sec_implicit_index_fn with -fcilkplus and __builtin_sadd_overflow()
Date: Sat, 15 Nov 2014 08:39:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status assigned_to
Message-ID: <bug-63884-4-HxKDGak1ty@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63884-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63884-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-11/txt/msg01311.txt.bz2
Content-length: 571

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc884

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
It's just that the Cilk code isn't prepared for internal functions, which have
NULL CALL_EXPR_FN.

I'll prepare a patch.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT
  2014-10-13 18:49 [Bug target/63527] New: [5 Regression] -fPIC generates more instructions hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2014-11-15  8:29 ` ubizjak at gmail dot com
@ 2014-11-20 12:24 ` rguenth at gcc dot gnu.org
  2014-11-25 20:20 ` vmakarov at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-20 12:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63527

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT
  2014-10-13 18:49 [Bug target/63527] New: [5 Regression] -fPIC generates more instructions hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2014-11-20 12:24 ` rguenth at gcc dot gnu.org
@ 2014-11-25 20:20 ` vmakarov at gcc dot gnu.org
  2014-11-25 20:54 ` hjl at gcc dot gnu.org
  2014-11-25 20:56 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: vmakarov at gcc dot gnu.org @ 2014-11-25 20:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63527

--- Comment #4 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
Author: vmakarov
Date: Tue Nov 25 20:20:10 2014
New Revision: 218059

URL: https://gcc.gnu.org/viewcvs?rev=218059&root=gcc&view=rev
Log:
2014-11-25  Vladimir Makarov  <vmakarov@redhat.com>

    PR target/63527
    * ira-lives.c (process_bb_node_lives): Check and remove conflict
    of pic pseudo with pic hard reg.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira-lives.c


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT
  2014-10-13 18:49 [Bug target/63527] New: [5 Regression] -fPIC generates more instructions hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2014-11-25 20:20 ` vmakarov at gcc dot gnu.org
@ 2014-11-25 20:54 ` hjl at gcc dot gnu.org
  2014-11-25 20:56 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: hjl at gcc dot gnu.org @ 2014-11-25 20:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63527

--- Comment #5 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Tue Nov 25 20:54:16 2014
New Revision: 218061

URL: https://gcc.gnu.org/viewcvs?rev=218061&root=gcc&view=rev
Log:
Add a test for PR target/63527

    PR target/63527
    * gcc.target/i386/pr63527.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr63527.c
Modified:
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT
  2014-10-13 18:49 [Bug target/63527] New: [5 Regression] -fPIC generates more instructions hjl.tools at gmail dot com
                   ` (6 preceding siblings ...)
  2014-11-25 20:54 ` hjl at gcc dot gnu.org
@ 2014-11-25 20:56 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-25 20:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63527

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-11-25 20:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-13 18:49 [Bug target/63527] New: [5 Regression] -fPIC generates more instructions hjl.tools at gmail dot com
2014-10-14  0:04 ` [Bug target/63527] [5 Regression] -fPIC uses 2 registers for GOT hjl.tools at gmail dot com
2014-10-14  7:51 ` rguenth at gcc dot gnu.org
2014-11-10 22:17 ` ubizjak at gmail dot com
2014-11-15  8:29 ` ubizjak at gmail dot com
2014-11-20 12:24 ` rguenth at gcc dot gnu.org
2014-11-25 20:20 ` vmakarov at gcc dot gnu.org
2014-11-25 20:54 ` hjl at gcc dot gnu.org
2014-11-25 20:56 ` hjl.tools at gmail dot com

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).