This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix incorrect devirtualization (PR middle-end/48661)
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, Martin Jambor <mjambor at suse dot cz>, Richard Guenther <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Apr 2011 02:06:54 +0200
- Subject: Re: [PATCH] Fix incorrect devirtualization (PR middle-end/48661)
- References: <20110418214008.GE17079@tyan-ft48-01.lab.bos.redhat.com>
> Hi!
>
> If TREE_BINFO has BV_VCALL_INDEX set, this needs to be dynamically
> adjusted, but none of the callers are prepared to handle that.
> Thus, this patch makes devirtualization give up in those cases.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, trunk and 4.6.
> On the trunk the testcase ICEs before and after the patch in some new callgraph
> checking (added today or so, Honza?), on the branch it works just fine.
The ICE for me is:
jakub.C:77:1: error: a call to thunk improperly represented in the call graph:
# VUSE <.MEM_11>
D.2319_3 = D::_ZTv0_n24_NK1D1mEv (&q.D.2159);
void test()/26(14) @0x7ffff77066f0 (asm: _Z4testv) availability:available analyzed needed reachable body externally_visible finalized
called by: int main()/28 (1.00 per call) (can throw external)
calls: void bar(int)/1 (1.00 per call) void bar(int)/1 (1.00 per call) virtual int D::m() const/15 (1.00 per call) D::D(const A&)/14 (1.00 per call)
References:
Refering this function:
has 3 outgoing edges for indirect calls.
this is not my snaity check, but Martins and I think it means that somehow your
change is ineffective on mainline and we still devirtualize.
Martin, I declare this problem yours.
Honza