This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: -fno-inline-functions vs glibc's initfini


On Tue, Jan 31, 2012 at 1:13 PM, Roland McGrath <roland@hack.frob.com> wrote:
>
> From Richard's response it sounds like there is an easy fix that's
> compatible with both old and new GCC (-fno-inline). ÂI think we can do that
> right away without trouble, and get it onto release branches too.
>
> On the libc side more generally, I've become skeptical that the generic C
> version of initfini is worth continuing with. Â(I say this as the person
> who chose to do it that way in the first place.) ÂThese sorts of things
> always come up again and again. ÂIt's just damn little assembly code to
> write for each machine so you get it exactly right and need not worry about
> what next year's compiler does.
>
>
> Thanks,
> Roland


I've been carrying the following patch in my ibm/ branches for a while
due to us hitting something similar earlier last year. I'm not
opposed to working out a machine specific version. I'll have one of
my guys draft up a proof of concept for PowerPC.

Ryan

commit 1fe05ea95e1460e5e1cf1568a8ce3982f0f02de6
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:ÂÂ Tue May 3 17:26:17 2011 -0500

ÂÂÂ Prevent erroneous inline optimization of initfini.s on PowerPC64.

diff --git a/ChangeLog b/ChangeLog
index 66482ff..5913162 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-03 Ryan S. Arnold <rsa@us.ibm.com>
+
+ÂÂÂÂÂÂ * sysdeps/powerpc/powerpc64/Makefile (CFLAGS-initfini.s): Add
+ÂÂÂÂÂÂ -fno-inline to prevent potential erroneous optimization where init is
+ÂÂÂÂÂÂ inlined to branch directly to fini.
+
Â2011-02-23 Andreas Schwab <schwab@redhat.com>
 Ulrich Drepper <drepper@gmail.com>

diff --git a/sysdeps/powerpc/powerpc64/Makefile
b/sysdeps/powerpc/powerpc64/Makefile
index 78d4f07..fe96aae 100644
--- a/sysdeps/powerpc/powerpc64/Makefile
+++ b/sysdeps/powerpc/powerpc64/Makefile
@@ -28,7 +28,7 @@ elide-routines.os += hp-timing
Âifneq ($(elf),no)
Â# The initfini generation code doesn't work in the presence of -fPIC, so
Â# we use -fpic instead which is much better.
-CFLAGS-initfini.s += -fpic -O1
+CFLAGS-initfini.s += -fpic -O1 -fno-inline
Âendif
Âendif


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