diff options
author | Martin Jambor <mjambor@suse.cz> | 2010-04-27 12:07:47 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2010-04-27 12:07:47 +0200 |
commit | 78eaf7bf186397f1ea7ca581c1e76e543eaac9b6 (patch) | |
tree | 815344fd064a1ca431cddb228100fe10fdc26f05 /gcc/cgraphunit.c | |
parent | 5b56d3bbcab015c4dabf4c1ef82237ac0a37c792 (diff) | |
download | gcc-78eaf7bf186397f1ea7ca581c1e76e543eaac9b6.zip gcc-78eaf7bf186397f1ea7ca581c1e76e543eaac9b6.tar.gz gcc-78eaf7bf186397f1ea7ca581c1e76e543eaac9b6.tar.bz2 |
re PR middle-end/43812 (compiling .cc file with -fwhole-program results in ICE, in ipcp_iterate_stage, at ipa-cp.c:760)
2010-04-27 Martin Jambor <mjambor@suse.cz>
PR middle-end/43812
* ipa.c (dissolve_same_comdat_group_list): New function.
(function_and_variable_visibility): Call
dissolve_same_comdat_group_list when comdat group contains external or
newly local nodes.
* cgraphunit.c (verify_cgraph_node): Verify that same_comdat_group
lists are circular and that they contain only DECL_ONE_ONLY nodes.
* testsuite/g++.dg/ipa/pr43812.C: New test.
From-SVN: r158777
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index fcb96b2..51b4732 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -714,6 +714,32 @@ verify_cgraph_node (struct cgraph_node *node) error ("double linked list of clones corrupted"); error_found = true; } + if (node->same_comdat_group) + { + struct cgraph_node *n = node->same_comdat_group; + + if (!DECL_ONE_ONLY (node->decl)) + { + error ("non-DECL_ONE_ONLY node in a same_comdat_group list"); + error_found = true; + } + if (n == node) + { + error ("node is alone in a comdat group"); + error_found = true; + } + do + { + if (!n->same_comdat_group) + { + error ("same_comdat_group is not a circular list"); + error_found = true; + break; + } + n = n->same_comdat_group; + } + while (n != node); + } if (node->analyzed && gimple_has_body_p (node->decl) && !TREE_ASM_WRITTEN (node->decl) |