diff options
author | Richard Guenther <rguenther@suse.de> | 2011-11-09 08:32:26 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-11-09 08:32:26 +0000 |
commit | c5bdb340d6458e3df097f58d611e75f999e07653 (patch) | |
tree | 3512b02bcd94168e4a28559dc505e99e7c73172a /gcc | |
parent | 6c235090477f18ee7167a046bdf8102447217249 (diff) | |
download | gcc-c5bdb340d6458e3df097f58d611e75f999e07653.zip gcc-c5bdb340d6458e3df097f58d611e75f999e07653.tar.gz gcc-c5bdb340d6458e3df097f58d611e75f999e07653.tar.bz2 |
gimple-fold.c (canonicalize_constructor_val): Mark address-taken variables addressable.
2011-11-09 Richard Guenther <rguenther@suse.de>
* gimple-fold.c (canonicalize_constructor_val): Mark
address-taken variables addressable.
From-SVN: r181197
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/gimple-fold.c | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12425f4a..e2d23ea 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-11-09 Richard Guenther <rguenther@suse.de> + + * gimple-fold.c (canonicalize_constructor_val): Mark + address-taken variables addressable. + 2011-11-09 Ira Rosen <ira.rosen@linaro.org> PR tree-optimization/51015 diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 08b7ccc..0da5eef 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -137,9 +137,12 @@ canonicalize_constructor_val (tree cval) || TREE_CODE (base) == FUNCTION_DECL) && !can_refer_decl_in_current_unit_p (base)) return NULL_TREE; - if (cfun && gimple_referenced_vars (cfun) - && base && TREE_CODE (base) == VAR_DECL) - add_referenced_var (base); + if (base && TREE_CODE (base) == VAR_DECL) + { + TREE_ADDRESSABLE (base) = 1; + if (cfun && gimple_referenced_vars (cfun)) + add_referenced_var (base); + } /* Fixup types in global initializers. */ if (TREE_TYPE (TREE_TYPE (cval)) != TREE_TYPE (TREE_OPERAND (cval, 0))) cval = build_fold_addr_expr (TREE_OPERAND (cval, 0)); |