aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2011-01-14 03:27:32 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-01-14 03:27:32 +0000
commit3dac68b99e0aa1503c2743f70e67a84401002a45 (patch)
tree01bf0d7874de7304a90a873d92d8904544ec31c7 /gcc/go/gofrontend
parent632469d01e0652c465f9074d2ec7f5de1cb7dac9 (diff)
downloadgcc-3dac68b99e0aa1503c2743f70e67a84401002a45.zip
gcc-3dac68b99e0aa1503c2743f70e67a84401002a45.tar.gz
gcc-3dac68b99e0aa1503c2743f70e67a84401002a45.tar.bz2
Move clearing of flag_strict_aliasing to gcc interface.
From-SVN: r168774
Diffstat (limited to 'gcc/go/gofrontend')
-rw-r--r--gcc/go/gofrontend/gogo-tree.cc12
-rw-r--r--gcc/go/gofrontend/unsafe.cc7
2 files changed, 6 insertions, 13 deletions
diff --git a/gcc/go/gofrontend/gogo-tree.cc b/gcc/go/gofrontend/gogo-tree.cc
index bcb2519..ccd17c6 100644
--- a/gcc/go/gofrontend/gogo-tree.cc
+++ b/gcc/go/gofrontend/gogo-tree.cc
@@ -22,7 +22,6 @@ extern "C"
#include "convert.h"
#include "output.h"
#include "diagnostic.h"
-#include "rtl.h"
#ifndef ENABLE_BUILD_WITH_CXX
}
@@ -810,17 +809,6 @@ Gogo::write_globals()
// Pass everything back to the middle-end.
- if (this->imported_unsafe_)
- {
- // Importing the "unsafe" package automatically disables TBAA.
- flag_strict_aliasing = false;
-
- // This is a real hack. init_varasm_once has already grabbed an
- // alias set, which we don't want when we aren't going strict
- // aliasing. We reinitialize to make it do it again. FIXME.
- init_varasm_once();
- }
-
wrapup_global_declarations(vec, count);
cgraph_finalize_compilation_unit();
diff --git a/gcc/go/gofrontend/unsafe.cc b/gcc/go/gofrontend/unsafe.cc
index 51d812b..e219f61 100644
--- a/gcc/go/gofrontend/unsafe.cc
+++ b/gcc/go/gofrontend/unsafe.cc
@@ -6,6 +6,7 @@
#include "go-system.h"
+#include "go-c.h"
#include "types.h"
#include "gogo.h"
@@ -130,5 +131,9 @@ Gogo::import_unsafe(const std::string& local_name, bool is_local_name_exported,
if (add_to_globals)
this->add_named_object(no);
- this->imported_unsafe_ = true;
+ if (!this->imported_unsafe_)
+ {
+ go_imported_unsafe();
+ this->imported_unsafe_ = true;
+ }
}