This is the mail archive of the gcc-patches@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: [RFC]: patch to detect invalid and missing ATTRIBUTE const/pure


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


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