summaryrefslogtreecommitdiff
path: root/gcc/cgraphbuild.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraphbuild.c')
-rw-r--r--gcc/cgraphbuild.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index 6b8116a612a..3948cf62802 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -53,6 +53,12 @@ record_reference (tree *tp, int *walk_subtrees, void *data)
tree decl;
struct record_reference_ctx *ctx = (struct record_reference_ctx *)data;
+ t = canonicalize_constructor_val (t);
+ if (!t)
+ t = *tp;
+ else if (t != *tp)
+ *tp = t;
+
switch (TREE_CODE (t))
{
case VAR_DECL: