On Thu, Jan 29, 2015 at 04:21:15PM +0100, Richard Biener wrote:
> >>> PR target/64703
> >>> * target.def (has_function_descriptors): New hook.
> >>> * doc/tm.texi.in: Add TARGET_HAS_FUNCTION_DESCRIPTORS.
> >>> * doc/tc.texi: Regenerate.
> >>> * tree-ssa-alias.c (pt_solution_includes_base): New function,
> >>> extracted from..
> >>> (ref_maybe_used_by_call_p_1): ..here. Handle potential memory
> >>> reference by indirect calls on targets using function descriptors.
> >>> * config/rs6000/rs6000.c (TARGET_HAS_FUNCTION_DESCRIPTORS):
> >>> Define.
> >>> (rs6000_has_function_descriptors): New function.
> >>> gcc/testsuite/
> >>> * gcc.target/powerpc/pr64703.c: New.
Won't the patch pessimize say const method calls through vtable?
Though, say on:
struct A { virtual __attribute__((const)) int foo (int) const; };
int a, b;
A c;
int
foo (A *p)
{
a = 1;
b = 2;
int c = p->foo (3);
a = 3;
b = 4;
return c;
}
we don't DSE the first two a and b stores anyway.
Jakub