diff options
author | Marek Polacek <polacek@redhat.com> | 2013-08-30 10:24:49 +0200 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2013-08-30 10:24:49 +0200 |
commit | 1a986fd51aa96fbd0d66f4d52739356374912563 (patch) | |
tree | f5310553e69c8a35180556d9af7e66bdecac7f92 /gcc/go/go-gcc.cc | |
parent | 61fb959b676db6ca9ef0da335dfef0d8ec08e113 (diff) | |
parent | f85c9de6ba5165bc1b941ceb09e4e8ffb1c7eb0f (diff) | |
download | gcc-ubsan.tar.gz |
Merge branch 'master' of git+ssh://gcc.gnu.org/git/gcc into ubsanubsan
Diffstat (limited to 'gcc/go/go-gcc.cc')
-rw-r--r-- | gcc/go/go-gcc.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index 1ecfaffd73a..025bb2bdca0 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -1475,8 +1475,8 @@ Gcc_backend::temporary_variable(Bfunction* function, Bblock* bblock, // Create a named immutable initialized data structure. Bvariable* -Gcc_backend::immutable_struct(const std::string& name, bool, bool, - Btype* btype, Location location) +Gcc_backend::immutable_struct(const std::string& name, bool is_hidden, + bool, Btype* btype, Location location) { tree type_tree = btype->get_tree(); if (type_tree == error_mark_node) @@ -1490,6 +1490,8 @@ Gcc_backend::immutable_struct(const std::string& name, bool, bool, TREE_CONSTANT(decl) = 1; TREE_USED(decl) = 1; DECL_ARTIFICIAL(decl) = 1; + if (!is_hidden) + TREE_PUBLIC(decl) = 1; // We don't call rest_of_decl_compilation until we have the // initializer. @@ -1503,8 +1505,7 @@ Gcc_backend::immutable_struct(const std::string& name, bool, bool, void Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&, - bool is_hidden, bool is_common, Btype*, - Location, + bool, bool is_common, Btype*, Location, Bexpression* initializer) { tree decl = var->get_tree(); @@ -1515,12 +1516,7 @@ Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&, DECL_INITIAL(decl) = init_tree; // We can't call make_decl_one_only until we set DECL_INITIAL. - if (!is_common) - { - if (!is_hidden) - TREE_PUBLIC(decl) = 1; - } - else + if (is_common) make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl)); // These variables are often unneeded in the final program, so put |