> With x86_64 linux the call to Run through object d is devirtualized.
> Whereas it looks like in ia64 hp-ux it is not devirtualized.
>
> -fdump-tree-fre1 output for both:
>
> ---- x86_64 linux:
>
>   MEM[(struct B *)&d]._vptr.B = &MEM[(void *)&_ZTV1B + 16B];
>   d.D.2197._vptr.B = &MEM[(void *)&_ZTV1D + 16B];
>   D.2248_1 = &MEM[(void *)&_ZTV1D + 16B];
>   D.2249_2 = Run;
>   D::Run (&d.D.2197);
>   d ={v} {CLOBBER};
>   return 0;
>
> ---- ia64 hp-ux:
>
>   MEM[(struct B *)&d]._vptr.B = &MEM[(void *)&_ZTV1B + 16B];
>   d.D.1878._vptr.B = &MEM[(void *)&_ZTV1D + 16B];
>   D.1929_1 = &MEM[(void *)&_ZTV1D + 16B];
>   D.1930_2 = (int (*__vtbl_ptr_type) ()) &MEM[(void *)&_ZTV1D + 16B];
>   OBJ_TYPE_REF(D.1930_2;&d.D.1878->0) (&d.D.1878);
>
> Is it a bug (unexpected with O1 compilation) that it is not optimized to
> direct call?

I'd think so, IA-64 uses a specific construct for its vtables because of the 
ABI requirements.

-- 
Eric Botcazou

Reply via email to