summaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-27 10:07:47 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-27 10:07:47 +0000
commitc524ac5d780d0e6536fac23bcc8be16df8fd98c7 (patch)
tree815344fd064a1ca431cddb228100fe10fdc26f05 /gcc/cgraphunit.c
parent7cbee41801178b64f13a838281cd72aee317a0e8 (diff)
downloadgcc-c524ac5d780d0e6536fac23bcc8be16df8fd98c7.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158777 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index fcb96b2044c..51b4732b45a 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)