summaryrefslogtreecommitdiff
path: root/gcc/ipa-reference.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-reference.c')
-rw-r--r--gcc/ipa-reference.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index 5e1a6ebbaeb..1a962c52cdb 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -267,6 +267,10 @@ has_proper_scope_for_analysis (tree t)
if (DECL_EXTERNAL (t) || TREE_PUBLIC (t))
return false;
+ /* We cannot touch decls where the type needs constructing. */
+ if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (t)))
+ return false;
+
/* This is a variable we care about. Check if we have seen it
before, and if not add it the set of variables we care about. */
if (!bitmap_bit_p (all_module_statics, DECL_UID (t)))