[Bug bootstrap/40027] [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld
--- Comment #8 from ro at gcc dot gnu dot org 2009-05-25 12:56 --- Fixed for 4.4.1, 4.5.0. -- ro at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40027
[Bug bootstrap/40027] [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld
--- Comment #7 from ro at gcc dot gnu dot org 2009-05-25 12:13 --- Subject: Bug 40027 Author: ro Date: Mon May 25 12:13:38 2009 New Revision: 147846 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147846 Log: PR bootstrap/40027 * config/i386/i386.c (USE_HIDDEN_LINKONCE): Only define if missing. * config/i386/sol2.h [!TARGET_GNU_LD] (USE_HIDDEN_LINKONCE): Define. Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/config/i386/i386.c branches/gcc-4_4-branch/gcc/config/i386/sol2.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40027
[Bug bootstrap/40027] [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld
--- Comment #6 from ro at gcc dot gnu dot org 2009-05-25 12:12 --- Subject: Bug 40027 Author: ro Date: Mon May 25 12:12:08 2009 New Revision: 147845 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147845 Log: PR bootstrap/40027 * config/i386/i386.c (USE_HIDDEN_LINKONCE): Only define if missing. * config/i386/sol2.h [!TARGET_GNU_LD] (USE_HIDDEN_LINKONCE): Define. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c trunk/gcc/config/i386/sol2.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40027
[Bug bootstrap/40027] [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld
-- rguenth at gcc dot gnu dot org changed: What|Removed |Added Keywords||build Priority|P3 |P4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40027
[Bug bootstrap/40027] [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld
-- rguenth at gcc dot gnu dot org changed: What|Removed |Added Target Milestone|--- |4.4.1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40027
[Bug bootstrap/40027] [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld
--- Comment #5 from ro at techfak dot uni-bielefeld dot de 2009-05-13 13:02 --- Subject: Re: [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld jakub at gcc dot gnu dot org writes: > Look for DEEP_BRANCH_PREDICTION in config/i386/*. On i386/i486/i586 doing > call 1f; 1: > is just fine, but on several newer CPUs it confuses return prediction logic > (more calls than rets), so when optimizing for those CPUs gcc calls a separate > pad which just reads the return address from the stack and immediately > returns. > This pad can be shared among all functions within the same binary or shared Ok, thanks for the explanation. > library. If hidden linkonce doesn't work on some Solaris version, you should > just make sure USE_HIDDEN_LINKONCE is 0 for that target. Indeed: that far easier than determining which version of Sun ld has all the necessary support. Proposed patch here: http://gcc.gnu.org/ml/gcc-patches/2009-05/msg00723.html Thanks. Rainer -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40027
[Bug bootstrap/40027] [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld
--- Comment #4 from jakub at gcc dot gnu dot org 2009-05-07 16:52 --- Look for DEEP_BRANCH_PREDICTION in config/i386/*. On i386/i486/i586 doing call 1f; 1: is just fine, but on several newer CPUs it confuses return prediction logic (more calls than rets), so when optimizing for those CPUs gcc calls a separate pad which just reads the return address from the stack and immediately returns. This pad can be shared among all functions within the same binary or shared library. If hidden linkonce doesn't work on some Solaris version, you should just make sure USE_HIDDEN_LINKONCE is 0 for that target. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40027
[Bug bootstrap/40027] [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld
--- Comment #3 from ro at techfak dot uni-bielefeld dot de 2009-05-07 16:30 --- Subject: Re: [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld hjl dot tools at gmail dot com writes: > The difference is in how to get PC for -fPIC: > > bash-3.2$ cat p.c > void > foo () > { > bar (); > } > bash-3.2$ gcc -m32 -fPIC p.c -S -O3 -mtune=i386 [...] > bash-3.2$ gcc -m32 -fPIC p.c -S -O3 -mtune=i686 [...] That's what I saw already when comparing crtbegin.s for i386 and i686. What I still don't understand is why the code is different between those two. Rainer -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40027
[Bug bootstrap/40027] [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld
--- Comment #2 from hjl dot tools at gmail dot com 2009-05-06 14:51 --- (In reply to comment #1) > I've just confirmed the bug on i686-pc-solaris2.10. It doesn't occur on > i686-pc-solaris2.11, though, so this is indeed a Sun ld bug. > > I've got a few questions to resolve, though: > > * Why does generating code for i686 instead of i386 change gcc's assembler > output > so significantly? > The difference is in how to get PC for -fPIC: bash-3.2$ cat p.c void foo () { bar (); } bash-3.2$ gcc -m32 -fPIC p.c -S -O3 -mtune=i386 bash-3.2$ cat p.s .file "p.c" .text .p2align 2,,3 .globl foo .type foo, @function foo: pushl %ebp movl%esp, %ebp pushl %ebx subl$4, %esp call.L3 .L3: popl%ebx addl$_GLOBAL_OFFSET_TABLE_+[.-.L3], %ebx callb...@plt popl%eax popl%ebx leave ret .size foo, .-foo .ident "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)" .section.note.GNU-stack,"",@progbits bash-3.2$ gcc -m32 -fPIC p.c -S -O3 -mtune=i686 bash-3.2$ cat p.s .file "p.c" .text .p2align 4,,15 .globl foo .type foo, @function foo: pushl %ebp movl%esp, %ebp pushl %ebx call__i686.get_pc_thunk.bx addl$_GLOBAL_OFFSET_TABLE_, %ebx subl$4, %esp callb...@plt addl$4, %esp popl%ebx popl%ebp ret .size foo, .-foo .ident "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)" .section .text.__i686.get_pc_thunk.bx,"axG",@progbits,__i686.get_pc_thunk.bx,comdat .globl __i686.get_pc_thunk.bx .hidden __i686.get_pc_thunk.bx .type __i686.get_pc_thunk.bx, @function __i686.get_pc_thunk.bx: movl(%esp), %ebx ret .section.note.GNU-stack,"",@progbits bash-3.2$ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40027
[Bug bootstrap/40027] [4.4/4.5 regression] i686-pc-solaris2.10 bootstrap fails using Sun ld
--- Comment #1 from ro at gcc dot gnu dot org 2009-05-06 13:01 --- I've just confirmed the bug on i686-pc-solaris2.10. It doesn't occur on i686-pc-solaris2.11, though, so this is indeed a Sun ld bug. I've got a few questions to resolve, though: * Why does generating code for i686 instead of i386 change gcc's assembler output so significantly? * Is it possible to get the relevant CRs backported to Solaris 10 (or are fixes already included in recent linker/kernel patches)? * How to handle this in gcc/configure.ac? I'd like to avoid completely disabling hidden support on Solaris 10 (and even early versions of Solaris 11 before the linker bug got fixed). -- ro at gcc dot gnu dot org changed: What|Removed |Added CC||ro at gcc dot gnu dot org AssignedTo|unassigned at gcc dot gnu |ro at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-05-06 13:01:30 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40027