On 11-02-15 10:22, Dominique d'Humières wrote:

Le 10 févr. 2015 à 12:42, Tom de Vries <tom_devr...@mentor.com> a écrit :

I think we need to understand first what's going on.

Sure, my patch was mainly to silence the failures on my working tree.

In both test-cases, on Linux with -fpic the inlining of one funct ion into the 
other is not done, because we cannot be sure the function call in one function 
binds to the other function at runtime.

I don’t understand why -fpic should change the inlining decision (except 
register pressure and so on).


It's about symbol binding, not inlining heuristics.

So, is the inlining happening with -fpic for Darwin? If so, is that correct?

The inlining is happening for darwin. I don’t know if that is correct or not.

I found an explanation.

darwin.c:
...
/* Cross-module name binding.  Darwin does not support overriding
   functions at dynamic-link time, except for vtables in kexts.  */

bool
darwin_binds_local_p (const_tree decl)
{
  return default_binds_local_p_1 (decl,
                                  TARGET_KEXTABI && DARWIN_VTABLE_P (decl));
}
...

i386.c:
...
#if TARGET_MACHO
#undef TARGET_BINDS_LOCAL_P
#define TARGET_BINDS_LOCAL_P darwin_binds_local_p
#endif
...

This is probably the cause for the difference. I guess that means your patch is 
ok.

Thanks,
- Tom

Reply via email to