summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-28 08:25:34 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-28 08:25:34 +0000
commitf9c5b8f16ed6a61e456b58d4566b35c7692b90da (patch)
tree0771311416d969e037a6cfb97f85e10f3fe6cd6c /gcc/tree-ssa-structalias.c
parent6a9d853a0475ab27d5c6f7aea6677c5c841f266f (diff)
downloadgcc-f9c5b8f16ed6a61e456b58d4566b35c7692b90da.tar.gz
2014-07-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/61921 * tree-ssa-structalias.c (create_variable_info_for_1): Check if there is a varpool node before dereferencing it. * gfortran.dg/pr61921.f90: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213114 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 1879fc0b8ff..0aa0c4bfd5b 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -5650,6 +5650,7 @@ create_variable_info_for_1 (tree decl, const char *name)
auto_vec<fieldoff_s> fieldstack;
fieldoff_s *fo;
unsigned int i;
+ varpool_node *vnode;
if (!declsize
|| !tree_fits_uhwi_p (declsize))
@@ -5671,7 +5672,8 @@ create_variable_info_for_1 (tree decl, const char *name)
in IPA mode. Else we'd have to parse arbitrary initializers. */
&& !(in_ipa_mode
&& is_global_var (decl)
- && varpool_node::get (decl)->get_constructor ()))
+ && (vnode = varpool_node::get (decl))
+ && vnode->get_constructor ()))
{
fieldoff_s *fo = NULL;
bool notokay = false;