This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PowerPC 32 : GOT access not optimized for DSO-scope static variable ?


On Fri, Jun 14, 2013 at 04:37:27PM +0200, yon ar c'hall wrote:
> So is there any possible optimization regarding static DSO scope
> variables access (and variables with visibility=hidden as well) for
> PowerPC ?

It is possible, but gcc -m32 does not implement this sort of
optimisation.  gcc -m64 does.  eg.

.L.f1:
        addis 9,2,static_var@toc@ha
        lwz 3,static_var@toc@l(9)
        extsw 3,3
        blr

vs.

        .section        ".toc","aw"
.LC0:
        .quad   global_var
        .text
.L.f2:
        addis 10,2,.LC0@toc@ha
        ld 9,.LC0@toc@l(10)
        lwz 3,0(9)
        extsw 3,3
        blr

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]