From: Martin Jambor Date: Fri, 22 Jul 2011 15:35:48 +0000 (+0200) Subject: re PR lto/49796 (483.xalancbmk/447.dealII in SPEC CPU 2006 failed to build) X-Git-Tag: releases/gcc-4.7.0~5195 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b75d1e2107d37a1a6d0fb3b3adc56a275ed711bf;p=thirdparty%2Fgcc.git re PR lto/49796 (483.xalancbmk/447.dealII in SPEC CPU 2006 failed to build) 2011-07-22 Martin Jambor PR lto/49796 * cgraphunit.c (verify_edge_corresponds_to_fndecl): Return false if decl node is in another partition, call cgraph_get_node only once. From-SVN: r176630 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 19e6a8e83ff9..aae9d0840371 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-07-22 Martin Jambor + + PR lto/49796 + * cgraphunit.c (verify_edge_corresponds_to_fndecl): Return false + if decl node is in another partition, call cgraph_get_node only + once. + 2011-07-22 Uros Bizjak * config.gcc (x86_64-*-linux*): Set diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 83ac720c7974..93664f9d8a49 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -456,17 +456,23 @@ cgraph_debug_gimple_stmt (struct function *this_cfun, gimple stmt) static bool verify_edge_corresponds_to_fndecl (struct cgraph_edge *e, tree decl) { - if (!e->callee->global.inlined_to - && decl - && cgraph_get_node (decl) - && (e->callee->former_clone_of - != cgraph_function_or_thunk_node (cgraph_get_node (decl), NULL)->decl) + struct cgraph_node *node; + + if (!decl || e->callee->global.inlined_to) + return false; + node = cgraph_get_node (decl); + + /* We do not know if a node from a different partition is an alias or what it + aliases and therefore cannot do the former_clone_of check reliably. */ + if (!node || node->in_other_partition) + return false; + node = cgraph_function_or_thunk_node (node, NULL); + + if ((e->callee->former_clone_of != node->decl) /* IPA-CP sometimes redirect edge to clone and then back to the former function. This ping-pong has to go, eventaully. */ - && (cgraph_function_or_thunk_node (cgraph_get_node (decl), NULL) - != cgraph_function_or_thunk_node (e->callee, NULL)) - && !clone_of_p (cgraph_get_node (decl), - e->callee)) + && (node != cgraph_function_or_thunk_node (e->callee, NULL)) + && !clone_of_p (node, e->callee)) return true; else return false;