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: [PATCH] Don't optimize function addresses


On Tue, Apr 08, 2008 at 02:25:03PM -0400, John David Anglin wrote:
> > My only concern would be whether or not we should make your change 
> > somehow conditional on whether or not the target abi uses function 
> > descriptors.  It'd be a shame to pessimize all those embedded targets 
> > which don't have to deal with such hair.
> 
> Jakub also expressed this viewpoint.  However, it's just not clear
> to me how much this actually pessimizes embedded targets.  I think
> the only code that actually needs to test the least significant bits
> of function pointers is ABI/runtime specific.

There are also risks with that optimization even on non-descriptor targets.
When gcc uses some alignment for functions it generates, it would assume
that some least significant bits are zero, yet sometimes that alignment
isn't HW mandated and e.g. some assembly written function you call might
have smaller alignment.  The optimization would make function alignment
part of the ABIs, I'm not sure it is part of all ABIs ATM though.

	Jakub


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