From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20594 invoked by alias); 16 Sep 2010 17:37:21 -0000 Received: (qmail 20502 invoked by uid 48); 16 Sep 2010 17:36:59 -0000 Date: Thu, 16 Sep 2010 17:37:00 -0000 Message-ID: <20100916173659.20501.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/45453] [4.6 Regression] ICE: verify_cgraph_node failed: inlined_to pointer set for noninline callers with -O2 -fno-early-inlining In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "hubicka at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-09/txt/msg01869.txt.bz2 ------- Comment #3 from hubicka at gcc dot gnu dot org 2010-09-16 17:36 ------- Hmm, the problem is that foo is virtual self recursive function. We inline it and then indirect inlining decide that it can devirtualize the self recursive call since it knows the operand has proper type. At that time we already removed the function from callgraph since all direct calls was resolved, it is COMDAT and corresponding vtable is elsehwere. We have options: 1) Prevent devirtualization in this case 2) Special case COMDAT virtual functions in inliner and prevent them from being removed early 3) Make inliner to re-invent nodes for those functions. All solutions are sort of wrong. I am leaning towards 2) with extra code keeping virtual COMDAT till inlining stage (similarly as we do with extern inlines) so possible indirect calls can be resolved. Will give this a try. Proper solution here is probably introduction of may edges... Martin: Can we devirtualize the recursive call always based on fact that we go to the function so it got to be of proper type? Honza -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45453