diff options
author | Richard Guenther <rguenther@suse.de> | 2011-11-08 11:23:11 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-11-08 11:23:11 +0000 |
commit | 4835617e59619b69f51d7ee98ec6dc1622ee8243 (patch) | |
tree | 2d03c9a364f33070517a274f2636c98466981f83 /gcc | |
parent | 0a35513e4e73ec9c6f24e791d344308ad3ed030d (diff) | |
download | gcc-4835617e59619b69f51d7ee98ec6dc1622ee8243.zip gcc-4835617e59619b69f51d7ee98ec6dc1622ee8243.tar.gz gcc-4835617e59619b69f51d7ee98ec6dc1622ee8243.tar.bz2 |
gimple-fold.c (canonicalize_constructor_val): Make sure we have referenced vars setup before adding to them.
2011-11-08 Richard Guenther <rguenther@suse.de>
* gimple-fold.c (canonicalize_constructor_val): Make sure
we have referenced vars setup before adding to them.
From-SVN: r181155
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/gimple-fold.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e6816e5..c128751 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-11-08 Richard Guenther <rguenther@suse.de> + + * gimple-fold.c (canonicalize_constructor_val): Make sure + we have referenced vars setup before adding to them. + 2011-11-07 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Andrew MacLeod <amacleod@redhat.com> diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 53bfb96..08b7ccc 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -137,7 +137,8 @@ canonicalize_constructor_val (tree cval) || TREE_CODE (base) == FUNCTION_DECL) && !can_refer_decl_in_current_unit_p (base)) return NULL_TREE; - if (cfun && base && TREE_CODE (base) == VAR_DECL) + if (cfun && gimple_referenced_vars (cfun) + && base && TREE_CODE (base) == VAR_DECL) add_referenced_var (base); /* Fixup types in global initializers. */ if (TREE_TYPE (TREE_TYPE (cval)) != TREE_TYPE (TREE_OPERAND (cval, 0))) |