diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-10-04 23:16:32 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-10-04 23:16:32 +0000 |
commit | 1d3e350227750ff642fb3693e3e93e5494ef4a9d (patch) | |
tree | 3a08199a03a3fc9e8b870356ff11604abc820087 /gcc | |
parent | 0e83f45aa68afba1d7938b186a90e3db3a3f0ee2 (diff) | |
download | gcc-1d3e350227750ff642fb3693e3e93e5494ef4a9d.zip gcc-1d3e350227750ff642fb3693e3e93e5494ef4a9d.tar.gz gcc-1d3e350227750ff642fb3693e3e93e5494ef4a9d.tar.bz2 |
Fix global var initialized to function call with calls as arguments.
From-SVN: r179529
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/gogo.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index 9df9402..f1f7680 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -2063,6 +2063,8 @@ Order_eval::variable(Named_object* no) return TRAVERSE_SKIP_COMPONENTS; } + Expression* orig_init = init; + for (Find_eval_ordering::const_iterator p = find_eval_ordering.begin(); p != find_eval_ordering.end(); ++p) @@ -2087,6 +2089,9 @@ Order_eval::variable(Named_object* no) var->add_preinit_statement(this->gogo_, s); } + if (init != orig_init) + var->set_init(init); + return TRAVERSE_SKIP_COMPONENTS; } |