This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC]: patch to detect invalid and missing ATTRIBUTE const/pure
- From: Jakub Jelinek <jakub at redhat dot com>
- To: John Wehle <john at feith dot com>
- Cc: ghazi at caip dot rutgers dot edu, dann at ics dot uci dot edu, gcc-patches at gcc dot gnu dot org, jh at suse dot cz, mark at codesourcery dot com, rth at redhat dot com
- Date: Fri, 22 Mar 2002 14:51:56 -0500
- Subject: Re: [RFC]: patch to detect invalid and missing ATTRIBUTE const/pure
- References: <200203221941.g2MJfOM05778@jwlab.FEITH.COM>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Mar 22, 2002 at 02:41:24PM -0500, John Wehle wrote:
> I'll also look at having the x86 backend omit loading the PIC register
> when the visibility is set to internal if someone doesn't / hasn't
> beat me to it.
Richard did, but it isn't that strightforward.
There are 2 things to consider:
- not every -fPIC routine which calls other routines (MODULE_LOCAL_P only)
actually loads PIC register, so if you omit loading of the PIC register
for internal visibility functions, their callers would be forced now to
us it (which would mean basically all library entry points would need
to load PIC register, which can be a win, but can be a lose too)
- if internal visibility is defined to be function that can be called only
from the same module (unlike static functions which can be called from
anywhere through function pointers), then this would force all
functions which ever do some indirect call (for which it cannot be proven
that it cannot be internal visibility function) to load PIC register,
which is likely a big disadvantage.
Of course, internal visibility can be defined too as function which
is only called from the same module using direct call, but then there is
question who would check this (either compiler would need to forbid
taking address of internal visibility functions, or linker would need
to issue error if it sees non-direct function call reloc against internal
visibility symbol).
Jakub