aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-05-30 17:39:37 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-05-30 15:39:37 +0000
commitbabf1701b1e5a198e81d4cd715f076d047fad159 (patch)
tree400b9757b5182f576a606b5cc778afbe17414093 /gcc
parentfbd767b1b5d7c560272275e9e70f52f4f3a4e715 (diff)
downloadgcc-babf1701b1e5a198e81d4cd715f076d047fad159.zip
gcc-babf1701b1e5a198e81d4cd715f076d047fad159.tar.gz
gcc-babf1701b1e5a198e81d4cd715f076d047fad159.tar.bz2
toplev.c (wrapup_global_declaration_2): Avoid creation of new varpool nodes
* toplev.c (wrapup_global_declaration_2): Avoid creation of new varpool nodes From-SVN: r160056
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/toplev.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 26b1dbb..2c3b000 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-30 Jan Hubicka <jh@suse.cz>
+
+ * toplev.c (wrapup_global_declaration_2): Avoid creation of new varpool
+ nodes
+
2010-05-30 Richard Guenther <rguenther@suse.de>
* tree-cfg.c (verify_gimple_assign_single): Implement
diff --git a/gcc/toplev.c b/gcc/toplev.c
index dc677a3..ff4c850 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -772,17 +772,19 @@ wrapup_global_declaration_2 (tree decl)
{
struct varpool_node *node;
bool needed = true;
- node = varpool_node (decl);
+ node = varpool_get_node (decl);
- if (node->finalized)
+ if (!node && flag_ltrans)
needed = false;
- else if (node->alias)
+ else if (node && node->finalized)
+ needed = false;
+ else if (node && node->alias)
needed = false;
else if (!cgraph_global_info_ready
&& (TREE_USED (decl)
|| TREE_USED (DECL_ASSEMBLER_NAME (decl))))
/* needed */;
- else if (node->needed)
+ else if (node && node->needed)
/* needed */;
else if (DECL_COMDAT (decl))
needed = false;